Borrar filtros
Borrar filtros

Problel with save ommande

1 visualización (últimos 30 días)
B.E.
B.E. el 23 de Dic. de 2019
Comentada: Walter Roberson el 23 de Dic. de 2019
I have a problem with the save command in this code
Warning Variable 'x' cannot saved to MAT-file whose version is older than 7.3
To save this variable, use the -v.3 switch
t=0:0.1:1825;
N=length(t);
x=zeros(N,N);
for n=2:N
x(1,n)=1;
for i=2:N
z=RK4(t(n-1),t(n),2,x(i-1,n-1));
x(i,n)=z(end);
clear z
end
end
save('x.mat','x');
clear x

Respuesta aceptada

Walter Roberson
Walter Roberson el 23 de Dic. de 2019
Your x is 18251 elements long, so N = 18251 . You create your x array as N x N double precision, which is 18251 x 18251 x 8 bytes/entry = 2664792008 bytes, which is about 2.5 gigabytes.
MATLAB's -v7 default save format cannot save variables that are larger than 2 gigabytes.
You will need to use
save('x.mat', 'x', '-v7.3')
  2 comentarios
B.E.
B.E. el 23 de Dic. de 2019
Anthore question, the calculation time required is about . Is that normal?
Knowing that for , the calculation time is about
Walter Roberson
Walter Roberson el 23 de Dic. de 2019
You should probably try vectorizing RK4

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Search Path en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by