how to treat dataset as matrix

조회 수: 24 (최근 30일)
CJ
CJ 2013년 4월 19일
답변: Aasim 2014년 2월 4일
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
Ahmed A. Selman
Ahmed A. Selman 2013년 4월 20일
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.

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

답변 (2개)

Aasim
Aasim 2014년 2월 4일
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 2013년 4월 20일
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.

Community Treasure Hunt

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

Start Hunting!

Translated by