Structure inside a while loop && pixel distance
古いコメントを表示
I want to create a structure that stores my array inside a loop
for Example Every time it will generate a data stored in result array. let's say, I have N result. I want to stored into a 1XN structure. How to do that inside a loop?
I have tried for i=1:10
second Qusetion, For example, I have a M x N array. a pixel (m,n) And I used j=(n-1)*M+m convert pixel into the order in Array(:) Is there a way to know the distance between two pixels?
like (3,2) and (3,3) just have 1 unit distance
s=struct('num2str(i)',{result})
But it won't work
Thanks
採用された回答
その他の回答 (1 件)
Joakim Magnusson
2014 年 8 月 12 日
編集済み: Joakim Magnusson
2014 年 8 月 12 日
0 投票
You are trying to create field names named 1,2,3 ... but that is not possible because the field name have to start with a letter.
カテゴリ
ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!