plot excel data in MATLAB
古いコメントを表示
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..
採用された回答
その他の回答 (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 件のコメント
Samer Husam
2012 年 7 月 14 日
Walter Roberson
2012 年 7 月 14 日
The array "num" that is returned by xlsread() is a numeric array instead of a cell array.
x = num(1:10,1);
y = num(1:10,2);
plot(x,y)
Samer Husam
2012 年 7 月 14 日
Samer Husam
2012 年 7 月 14 日
Walter Roberson
2012 年 7 月 14 日
The letters correspond to column numbers, which are the second coordinate. The numbers correspond to rows, which are the first coordinate.
A6 = num(6,1);
B6 = num(6,2);
Samer Husam
2012 年 7 月 14 日
Azzi Abdelmalek
2012 年 7 月 14 日
num is double, u have not to use cell2mat
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 日
0 投票
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 件のコメント
Walter Roberson
2017 年 5 月 14 日
What is your current code?
Which MATLAB version are you using?
Image Analyst
2017 年 5 月 14 日
What does "attested" mean in this context?
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.
カテゴリ
ヘルプ センター および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!