フィルターのクリア

for loop append variable

6 ビュー (過去 30 日間)
il147
il147 2022 年 2 月 18 日
コメント済み: il147 2022 年 2 月 22 日
i'd like to append variable n0 to n1
but this code made just last variable
Thanks!
leng=length(list)
n0=[]
for i=1:leng
nl=list(i).name
end
  6 件のコメント
Stephen23
Stephen23 2022 年 2 月 18 日
That is why I showed you this approach:
{list.name}.'
Much simpler than a loop.
il147
il147 2022 年 2 月 18 日
It works!!!! Thanks for your help!!

サインインしてコメントする。

採用された回答

KSSV
KSSV 2022 年 2 月 18 日
編集済み: KSSV 2022 年 2 月 18 日
You can make it a cell array.
leng=length(list)
nl = cell(leng,1) ;
for i=1:leng
nl{i}=list(i).name
end
You may access n1{1}.........n1{10}
  3 件のコメント
KSSV
KSSV 2022 年 2 月 18 日
You can do the same as shown above. Store them into a cell array.
il147
il147 2022 年 2 月 22 日
Do you have any idea to make it matrix form not cell array?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by