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...

답변 (1개)

Jan
Jan 2017년 5월 29일

0 개 추천

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
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.

댓글을 달려면 로그인하십시오.

카테고리

태그

질문:

2017년 5월 29일

댓글:

Jan
2017년 5월 29일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by