How do you I get my program to label the axes using the column headings in my excel file?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jason
el 2 de Nov. de 2014
Comentada: Jason
el 2 de Nov. de 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 comentarios
Respuesta aceptada
Image Analyst
el 2 de Nov. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Import from MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!