plot excel data in MATLAB
조회 수: 20 (최근 30일)
이전 댓글 표시
hi all, I have two column in excel I want to plot them by using matlab, lets say I have first column from A1-A10 and second column from B1-B10. how could I plot them in MATLAB ?? please help..
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2012년 7월 14일
[v,T,vT]=xlsread('name.xls')
% 'xlsx' for exell 2007
%v: Double
%T and vT : cell
%use v containing numbers
t=v(:,1);y=v(:,2)
%if u have to plot second colone depending on first:
plot(t,y)
댓글 수: 11
Azzi Abdelmalek
2012년 7월 18일
maby you are ploting num(6:16,1) wich is false,you must use num(:,1)) for the first row and num(:,2) for the second. i don't think you will have an error message
추가 답변 (2개)
Image Analyst
2012년 7월 14일
편집: Image Analyst
2012년 7월 14일
Use xlsread() to get the entire contents of your workbook into a cell array.
[num,txt,raw] = xlsread(filename); % From the help
Then use cell2mat or something to extract out columns into an x array and a y array.
x = cell2mat(num(1:10, 1)); % Untested
y = cell2mat(num(1:10, 2)); % Untested
Then, to plot, use
plot(x,y);
댓글 수: 9
Walter Roberson
2012년 7월 17일
What does size(num) show? And please show your xlsread() command so we are sure we are talking about the same options.
andhavarapu lokesh
2017년 3월 6일
I wanted to plot a excel sheet in matlab is there any method to scale the xaxis and yaxis commonly to all the sheets
arif hussain
2017년 5월 14일
Hello; Can someone please help me matlab doesn't plot my excel data it show the axis only.i have attested the excel file as well.

댓글 수: 4
dpb
2017년 5월 15일
Almost certainly a spellcheck miss from a non-English speaker attempting "attached".
Image Analyst
2017년 5월 15일
I guess that makes sense, instead of "verified". However the file was NOT attached - only a screenshot was displayed, no Excel file was attached. Use the paperclip icon.
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!