Execute functions automatically

Dear all, I have a problem: I have to execute for 1000-2000 times a command like: wavef1=Readwav('ch1probe001.trc'), wavef2=Readwav('ch1probe002.trc'), wavef3=Readwav('ch1probe003.trc'), etc. Any suggestion? I don't know if I can use a for cicle wavef(k)=Readwav('ch1probe(k).trc') for k=001:1:1000...

 采纳的回答

This is basically FAQ 4.6
You really do not want to do this. You can use cell arrays to accomplish something very similar:
wavef = cell(1000, 1);
for ii = 1:1000
wavef{ii} = redwav(['ch1probe', num2str(ii), '.trc']);
end
Note the {} to make a cell array.

1 个评论

Thank you Daniel, honestly is the first time that I use {}: I really thank you for your complete answer.

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by