MATLAB Answers

Matlab does not save the variable in each loop

3 views (last 30 days)
farzad
farzad on 20 Apr 2020
Commented: farzad on 21 Apr 2020
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'.

  0 Comments

Sign in to comment.

Accepted Answer

per isakson
per isakson on 20 Apr 2020
you need to pre-allocate Tout, something like
N = appropriate value
Tout = cell(1,N);
before assigning values

  6 Comments

Show 3 older comments
farzad
farzad on 21 Apr 2020
How can I have different variable names in each row ? is it possible to use matlab structures?
farzad
farzad on 21 Apr 2020
Is the question abbandoned ? @per isakson

Sign in to comment.

More Answers (0)