Values from For Loop Iteration to save on an extra m.File
1 view (last 30 days)
Show older comments
Hello, i have a .m-File with an For Loop Iteration. This .m-File calls another .m-File ( Main.m ) to solve some Variables ( for Example 'XXX' ) from the Iteration-Value PC
for PC=850:10:870
EG=1286
Main
save test.dat XXX
end
So the Program should take every new Iteration-Step into the Main.m and solve Things in it ( for Example Variable 'XXX' ) and then save it to a new .m-File ( for Example test.dat ). The Output should looks like this:
Column1(Iteration-Steps) Column2(Value of the Variable XXX form Main.m )
850 64874
860 65879
870 69766
I hope you Guys understand my Problem, big thx!
0 Comments
Accepted Answer
TAB
on 12 Dec 2012
Buff = zeros(numel(850:10:870),2);
Ctr = 1;
for PC=850:10:870
EG=1286
Main
Buff(Ctr, 1) = PC;
Buff(Ctr, 2) = XXX;
Ctr = Ctr+1;
end
save test.dat Buff;
0 Comments
More Answers (2)
See Also
Categories
Find more on Configure Simulation Conditions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!