How can I divert my program on a new program and return it?

1 次查看(过去 30 天)
I wrote a program which I named it "file1.m".After calculating some arrays and matrices, my program should go on the other program which I called it "file2.m" and after calculating some new matrices which are based on some matrices evaluated on "file1.m" before diverting to "file2.m" it should return to the same line of "file1.m" that it was ordered to go on "file2.m" and do other orders by using matrices evaluated in "file1.m" before going to "file2.m" and matrices calculated in "file2.m".
I don't know how can order my program "file1.m" to go on "file2.m" at a specific "file1.m" line and how to return it after finishing "file2.m" .
As I calculate some matrices and arrays in each of "file1.m" and "file2.m" with the help of matrices and arrays evaluated on the other file, I'm a doubtful whether this kind of writing and diverting bring about any problem like losing data or other similar problems.

回答(1 个)

Image Analyst
Image Analyst 2013-6-2
I don't know if you want to run those m-files and get values back that you want to save in your main program, or just run them. If you want to get something back, you'll have to have this (or similar) in a loop over all the m-files you want to run:
[out1, out2] = file1(in1, in2, in3);
Then do something with out1 and out2. Do the same for all other files you want to run.

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by