run multiple inputs on an m-file to get multiple putputs in a loop
이전 댓글 표시
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.
답변 (1개)
Jan
2011년 3월 23일
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
카테고리
도움말 센터 및 File Exchange에서 Data Import and Export에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!