not running after change

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.
Who is Participating?
yuk99Connect With a Mentor Commented:
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.
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.
IndarnavAuthor Commented:
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.
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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.
IndarnavAuthor Commented:
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.

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:
IndarnavAuthor Commented:
sending u complete set of files.
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.
IndarnavAuthor Commented:
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

IndarnavAuthor Commented:
i followed above method, but when i press F5 after changes... no graph comes?
IndarnavAuthor Commented:
thanks a lot, it is working fine now.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.