Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Save the results of a non scalar struct

1 visualización (últimos 30 días)
Deepa Maheshvare
Deepa Maheshvare el 5 de Mzo. de 2020
Cerrada: Stephen23 el 5 de Mzo. de 2020
I've the following function
function fun(i)
var = true
if var
ss(i).bv = rand(10,1)
if i == 4
pwd
save(fullfile(pwd, 'ss.mat'), 'ss');
end
end
The above function is called as below
for i = 1:4
i
fun(i)
end
The result is loaded,
l = load('ss.mat')
l.ss.bv
ans =
[]
ans =
[]
ans =
[]
ans =
0.8217
0.4299
0.8878
0.3912
0.7691
0.3968
0.8085
0.7551
0.3774
0.2160
I am not sure why the first there indices are empty. I want to store the results for all i.
Any suggestions?

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by