How to plot a graph by extracting the variables from each .mat file?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Anu
am 1 Dez. 2021
Kommentiert: Palguna Gopireddy
am 24 Feb. 2022
I have 10 .mat files in a folder. The name of each file is mean1.mat, mean2.mat, mean3.mat, and so on. In each mat file I have x and y as variables. I want to plot x and y extracted from each .mat file as a scatter plot. May I know how should I do it?
Thanks in advance.
0 Kommentare
Akzeptierte Antwort
KSSV
am 1 Dez. 2021
matFiles = dir('*.mat') ;
N = length(matFiles) ;
figure
hold on
for i = 1:N
load(matFiles(i).name) ;
scatter(x,y,[],'b','filled','c')
end
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!