PLOT from excel data
1 次查看(过去 30 天)
显示 更早的评论
Hallo, How can i plot the data from an excel sheet. I don't want to read the data of excel every time. Instead i want to store the data locally and call it once. For example i want to plot data from excel sheet with respect to multiple random cells a= C48:W48, b= C50:W50 c=C34:D34 d=B82:C82..... Plot(a,b,c,d..)
my code:
b = xlsread('abc.xlsm','Sheet1','C48:W48')
a = xlsread('abc.xlsm','Sheet1','C50:W50')
c = xlsread('abc.xlsm','Sheet1','C34:D34')
d = xlsread('abc.xlsm','Sheet1','B82:C82') %%eigen_1.............
..
plot(a,b,c,d...)
This takes lot of time because it reads excel file every time. PLease help since i am new to this...
0 个评论
回答(1 个)
Jan
2017-5-29
What about reading the Excel file once:
Data = xlsread('abc.xlsm', 'Sheet1')
Then indexing works e.g. by https://www.mathworks.com/matlabcentral/fileexchange/15806-excel-column-name-to-number, if you want an address like 'C48'.
1 个评论
Jan
2017-5-29
@aiyappa macharanda ganesh: The NaNs are no problem. You mentioned, that reading takes a lot of time. Reading the data once and extracting the wanted values later should be faster.
You post a diagram. Does this mean, that the problem is solved or do you have a question? I got similar diagrams, when I forgot to transpose the matrix for the input of the plot command. Please post the code in case of problems.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!