Matlab does not save the variable in each loop

1 visualización (últimos 30 días)
farzad
farzad el 20 de Abr. de 2020
Comentada: farzad el 21 de Abr. de 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'.

Respuesta aceptada

per isakson
per isakson el 20 de Abr. de 2020
you need to pre-allocate Tout, something like
N = appropriate value
Tout = cell(1,N);
before assigning values
  6 comentarios
farzad
farzad el 21 de Abr. de 2020
How can I have different variable names in each row ? is it possible to use matlab structures?
farzad
farzad el 21 de Abr. de 2020
Is the question abbandoned ? @per isakson

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by