how to add row and column label to a matrix and make it as a dataset?

조회 수: 2 (최근 30일)
Niki
Niki 2015년 6월 17일
댓글: Niki 2015년 6월 17일
I have a matrix look like below
df =randi(10,100,1)
I want to give row lable to do two ways, once I want to assing 50 first row as 1 row label and 50 second one as row label 2 once I want to assign another arrys which is a random lables as row lables to this matrix and have the final data as dataset.
any comment is appreciate

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 17일
편집: Azzi Abdelmalek 2015년 6월 17일
df =randi(10,100,1)
a=reshape(df,50,[])
out=mat2dataset(a)
  댓글 수: 2
Niki
Niki 2015년 6월 17일
Thanks for your comment but it did not solve my problem. first one all, it gets an error saying, product of known dimensions, 50, not divisible into total number of elemenst, 736. secodnly , how could i assign a vector of binary values as row labels to that matrix ?
Niki
Niki 2015년 6월 17일
I got another error for mat2dataset, Batch Dataset objects can only be created from numeric types ,(line 123) . Error in mat2 dataset (line 75) d= dataset(vars{:},args{:});

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

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by