run multiple inputs on an m-file to get multiple putputs in a loop
Show older comments
Thank yous o much for reading.. I want to put a .m file in a loop but with three other arrays sig and acs.and af=2.However size(sig)=8,74,80,10 and size(acs)=8,20,80,10. The m-file outputs recon and ws how can one store recon & ws for n=1:10. Sorry for the example:
for n=1:10 sig(n)=sig(:,:,:,n) acs(n)=acs(:,:,:,n) af=2 [recon,ws]=open(sig,acs,af) %m-file called open.m % save output recon(n) & ws(n) %?? end
Thank you so so much.
Answers (1)
Jan
on 23 Mar 2011
I'm not sutre what you mean by "save recon(n)", perhaps this:
recon = zeros(1, 10);
ws = zeros(1, 10);
for n = 1:10
sig_n = sig(:,:,:,n);
acs_n = acs(:,:,:,n);
af = 2;
[recon(n), ws(n)] = open(sig_n, acs_n, af);
end
Categories
Find more on Data Import and Export 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!