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?
Star Strider
Star Strider 2017 年 9 月 16 日
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 で Tables についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by