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?

 Respuesta aceptada

Star Strider
Star Strider el 16 de Sept. de 2017

0 votos

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 comentarios

Piotr Zmijewski
Piotr Zmijewski el 16 de Sept. de 2017
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 el 16 de Sept. de 2017
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.)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Preguntada:

el 16 de Sept. de 2017

Comentada:

el 16 de Sept. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by