Learn how to a build a cloud-first strategyRegister Now


not running after change

Posted on 2009-04-27
Medium Priority
Last Modified: 2016-02-10
i made attached program in matlab. it gets input from data1 file. when open matlab and run the attached file, it shows output. but when i open data1 file and change some value in that and save the changes and re run the main file,no output came.

why so? if i close all and re open then i shows output as per changes done.
Question by:Indarnav
  • 6
  • 5
LVL 15

Expert Comment

ID: 24243410
What do you mean "it shows output"? In the command line (your code does not suppose to show anything)? Or variables are not empty? I assume the second.

If you rerun your code without any changes in data1.m, no output again?
If you clear all variables before rerunning your code with 'clear all', will it change anything? Be careful not to delete variables not generated by your code that you may need.

Please give us more details what changes you make in data1.m. If possible please show some sample data. You can either attach it as a file or copy and paste into code snippet. Note you cannot upload m-file, rename its extension to txt first.

What code do you have after what you show. Is it only comments? Or something that may affect your data? If yes, please show it here also.

A note on your code. You can see a lot of orange bars (warnings) on the right. You don't need to use [] with single variable, only when you do concatenation, like [noele, nophases].
Also why keep your data in m-file? These file supposed to be matlab's functions and scripts.

Author Comment

ID: 24244470
attaching both files for your refernce.

file iflow_asymetrical.m is main file and data1.m is input data file. when u run iflow_asymetrical.m, it gives output as graph. when u make changes in data1.m and re run, you will not get graph, but if u restart matlab, it will show graph again.  

make changes in line 144 only in data1.m

change ext of both to .m after saving.
LVL 15

Expert Comment

ID: 24244859
What changes exactly do you make in data1.m?

Where are two unknown functions: ybus_asym and bx_asym. Is it one of those  creates a plot? Since there are no other plot functions in the code. I think your problem might be in one of those functions.

Before rerunning the code, do you close the figure or not? Are you sure there is no figure window in the background
You also didn't answer, what happens if you (1) rerun the code without changes. (2) doing clear all before.

Last question, what OS and Matlab version are you using? Just not to ask you later.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 24246891
attaching other required functions.kindly rename file to .rar and extract functions.

regarding your query.
1. if i re run code without changes,even then no graph generates.
2. yes i closed all graph windows before re run.
3. using vista
4. matlab 2009a/ 7.8 version.

LVL 15

Expert Comment

ID: 24247768
So the data1 editing is not the reason.
Did you try to do clear all?

If you don't have figure window after rerun, Matlab should return some error (in red) in Command Window. Please show it here.

Still don't have all the functions to test your code:

Author Comment

ID: 24248303
sending u complete set of files.
LVL 15

Expert Comment

ID: 24251370
I run the code for several time and have no problems (except no rad2deg function, but it should not be problem).
There is a pause command in the code. After you see figure you should press any key to continue. I hope you do it, right?
So, I probably can help if you answer two questions from my previous post.

Author Comment

ID: 24251538
please verify the method of operation

open matlab
open iflow...
press F5
it will display graph
close the graph
open data1
change value
save changes
close data1
press F5


Author Comment

ID: 24251551
i followed above method, but when i press F5 after changes... no graph comes?
LVL 15

Accepted Solution

yuk99 earned 2000 total points
ID: 24251653
You have to close the graph by pressing any key, not the other way. This is how it's coded. Your previous run is not finished when you close figure, it still waiting for your input. It stops only when you press F5 for the second time.

Author Comment

ID: 24252101
thanks a lot, it is working fine now.

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses
Course of the Month21 days, 2 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question