Read Excel file in Matlab and plot data
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Angel Lozada
am 6 Okt. 2025 um 16:54
Beantwortet: Star Strider
am 6 Okt. 2025 um 17:12
I am trying to plot the cloumn 2 (amplitude) vs column 1 (time).
However, I am getting the same error:
Unable to find or open 'HUAM1709.041_v2'. Check the path and filename or file permissions.
Error in
data = readtable('HUAM1709.041_v2');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Once I solve this inquiry I will be able to plot the other 2 amplitudes vs time.
Could you help yo identify the error?
Both .m file and excel file are in the same folder.
Attached will find excel file.
Thanks in advance.
T = data(:,1);
T = seconds(data(:,1));
T.Format = 'hh:mm';
T2 = data(:,2);
figure; % Place "figure" in this section allow to plot this data in a separate window.
plot (T,T2,'.');
title 'Accelerometer';
ylabel ('Amplitude');
xlabel ('Samples');
0 Kommentare
Akzeptierte Antwort
Star Strider
am 6 Okt. 2025 um 17:12
Use curly braces {} to access data in a table.
data = readtable('HUAM1709.041_v2.xlsx')
% return
T = data{:,1};
T = seconds(data{:,1});
T.Format = 'hh:mm';
T2 = data{:,2};
figure; % Place "figure" in this section allow to plot this data in a separate window.
plot (T,T2,'.');
title 'Accelerometer';
ylabel ('Amplitude');
xlabel ('Samples');
With those changes, you code works.
.
0 Kommentare
Weitere Antworten (1)
Walter Roberson
am 6 Okt. 2025 um 17:11
You need
data = readtable('HUAM1709.041_v2.xlsx');
When your provided filename has an extension, readtable does not attempt to add default extensions.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets 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!