Matlab does not save the variable in each loop

1 回表示 (過去 30 日間)
farzad
farzad 2020 年 4 月 20 日
コメント済み: farzad 2020 年 4 月 21 日
Hi all , using some advices from previously asked questions , I used indexing to append values to a table that I am gonna write on Excel file :
if f1==1
Tout{1}=[filename;Tit]
else
Tout{f1} = [Tout{f1-1};filename;Tit]
end
writetable(Tout{end},'All.xlsx')
But I get the error
Error: Undefined function or variable 'Tout'.

採用された回答

per isakson
per isakson 2020 年 4 月 20 日
you need to pre-allocate Tout, something like
N = appropriate value
Tout = cell(1,N);
before assigning values
  6 件のコメント
farzad
farzad 2020 年 4 月 21 日
How can I have different variable names in each row ? is it possible to use matlab structures?
farzad
farzad 2020 年 4 月 21 日
Is the question abbandoned ? @per isakson

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by