how to treat dataset as matrix

28 visualizaciones (últimos 30 días)
CJ
CJ el 19 de Abr. de 2013
Respondida: Aasim el 4 de Feb. de 2014
How to treat dataset as a matrix, then I can do sum, diff, time, as the matrix, all the data in the dataset are numerical data.
  1 comentario
Ahmed A. Selman
Ahmed A. Selman el 20 de Abr. de 2013
The dataset comes from a file or some input device.. or user input function? Each of these (and others) has it's own method to convert data to matrix.

Iniciar sesión para comentar.

Respuestas (2)

Aasim
Aasim el 4 de Feb. de 2014
But the cells should be of the same type. if they are different this gives error... how to do this for different types of data in the cells?

ARS
ARS el 20 de Abr. de 2013
If you are talking about converting a dataset array then this might be a possible solution.
First convert your dataset array to cell array using:
C = dataset2cell(D)
and then convert that cell array to simple matrix using:
A= cell2mat(C)
Hope this helps.
AMD.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by