I need to save result of three loops in same file data if you possible for plot graphs or curves in 3D ?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi freinds ,
I have some with Matlab I want to save a result in same file data or data file but I have three loops with (for )
can you help me for do that ?
thanks.
this is my example :
for mass_ratio =0.01:0.01:0.1 it means this vector has (10 element)
for frequency_tuning=0.85:0.1:1.15 it means this vector has (4 element)
for damping_ratio=0.01:0.01:0.2 it means this vector has (20 element)
%result %
displacement
acceleration
end
end
end
0 comentarios
Respuestas (1)
darova
el 15 de Feb. de 2020
example
mass_ratio = 0.01:0.01:0.1;
frequency_tuning = 0.85:0.1:1.15;
damping_ratio = 0.01:0.01:0.2;
displacement = zeros( length(mass_ratio),length(frequency_tuning), length(damping_ratio) );
acceleration = zeros( length(mass_ratio),length(frequency_tuning), length(damping_ratio) );
for i = 1:length(mass_ratio) %it means this vector has (10 element)
for j = 1:length(frequency_tuning) %it means this vector has (4 element)
for k = 1:length(damping_ratio) %it means this vector has (20 element)
%result %
displacement(i,j,k) = ...
acceleration(i,j,k) = ...
end
end
end
save data displacement acceleration
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!