Create array address using for loop
2 次查看(过去 30 天)
显示 更早的评论
Hi
I need to use for loop for creating address in structure example
For i=1:1:5000
[A(i),B(i),C(i)]=imread('fff',(i-1));
end;
I know this program is wrong.
I want files to be created as A1=some numbers,B1=some numbers....
A2=some numbers,B2=some numbers....
A3=some numbers,B3=some numbers....
A5000=some numbers,B5000=some numbers....
to be saved in workspace.
Thank you in advance
1 个评论
Stephen23
2019-9-20
编辑:Stephen23
2019-9-20
"I want files to be created as ... to be saved in workspace."
Files are saved on your harddrive.
Variables are what is contained in the MATLAB workspace.
"I know this program is wrong."
But using indexing is perfectly right. Indexing is simple, neat, easy to debug, and very efficient (unlike what you are trying to do).
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!