Loading multiple mat files and plot them right
Afficher commentaires plus anciens
I want to plot 3 different .mat files. My Structure looks something like this.
d = dir('*.mat');
Anzmat = length(d);
for j = 1:3 %just use the first 3 Files in the Order structure ->test 1, test 2, test 3
load(d(j).name)
%%%%%%%Calculations%%%%%%%
figure();
plot(t_LP, x_ac)
title('acceleration shorten file x-axis')
xlabel('time (s)')
ylabel('a (m/s^2)')
%%%%%%%Calculations%%%%%%%
figure();
plot(t_LP, y_ac)
title('acceleration shorten file y-axis')
xlabel('time (s)')
ylabel('a (m/s^2)')
%%%%%%%Calculations%%%%%%%
figure();
plot(t_LP, velocity_x)
title('velocity shorten file x-axis')
xlabel('time (s)')
ylabel('v (m/s)')
%%%%%%%Calculations%%%%%%%
figure();
plot(t_LP, velocity_y)
title('velocity shorten file y-axis')
xlabel('time (s)')
ylabel('v (m/s)')
%%%%%%%Calculations%%%%%%%
plot(t_LP,ac,'r')
title('final velocity')
xlabel('time (s)')
ylabel('v (m/s)')
end
Now my aim is to plot the Files: test 1, test 2, test 3 together in one diagramm. So in the end i should have 5 plots and in each are 3 diagramms from the test1,test2,test3 mat data. So i can clearly analyse how different the measurements are in one plot.
2 commentaires
Daniel Basow
le 18 Juil 2021
Modifié(e) : Daniel Basow
le 18 Juil 2021
Mathieu NOE
le 19 Juil 2021
hmm
there are a few answers / posts about why one should avoid dynamic variable names (and therefore not use assignin)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!