Hi
I have a problem, my xlxs is A:N and it has 489 rows. I can import data form xlsx to matlab as a table or as a dobule. What should i do next to do it as quick as posible to plot it?

 채택된 답변

Star Strider
Star Strider 2017년 9월 16일

0 개 추천

I would use the xlsread funciton (preferably) to read it to a matrix, or the readtable function to read it to a table. Your resulting matrix will be (489x14), so the plot of it may be difficult to interpret.

댓글 수: 2

Piotr Zmijewski
Piotr Zmijewski 2017년 9월 16일
ok i did it like this dane = readtable('a.xlsx');
and got dane as 4848x14 it is ok then take like this x=dane(:,1); y1=dane(:,2); y2=dane(:,3);
and each data is in table
but how to take it from table to double
when i did table2array i got each data as cell not as duble why?
First, I would not create separate ‘dynamic’ variables for each column. That is poor and inefficient programming practice. Please simply use the column references such as ‘dane(:,1)’, ‘dane(:,2)’ and so for the rest of the columns in your code.
Second, you can create a double array from your matrix by nesting your table2array call inside a cell2mat call:
dane_double = cell2mat(table2array(dane));
That should work in your code. (Name it something more convenient to type than ‘dare_double’. I named it that for clarity.)

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Import Data에 대해 자세히 알아보기

제품

질문:

2017년 9월 16일

댓글:

2017년 9월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by