I need to save result of three loops in same file data if you possible for plot graphs or curves in 3D ?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
darova
2020-2-15
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!