How do you I get my program to label the axes using the column headings in my excel file?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jason
am 2 Nov. 2014
Kommentiert: Jason
am 2 Nov. 2014
I have three column headers in an excel file: A1:A1 is time, B1:B1 is velocity. This is what I have so far but I cant get my plot to label the axes. Please help me out .
clear;
clc;
data = xlsread('veldata.xlsx');
t = data(:,1);
v1 = data(:,2);
v2 = data(:,3);
avg_v1v2 = ((v1 + v2)/2);
plot(t,v1,'b',t,v2,'g',t,avg_v1v2,'r:')
xlabel(xlsread('veldata.xlsx','Sheet1','A1:A1'))
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 2 Nov. 2014
[data, txt, raw] = xlsread('veldata.xlsx');
% other code...
col1Header = txt{1, 1};
col2Header = txt{1, 2};
xlabel(col1Header, 'FontSize', 25);
ylabel(col2Header, 'FontSize', 25);
Adapt as needed.
Weitere Antworten (0)
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!