defined categorical in same name but different number

조회 수: 1 (최근 30일)
mohammed hussein
mohammed hussein 2017년 11월 28일
댓글: Walter Roberson 2017년 11월 29일
Hi
can you help me with this problem . i have different range of number i want to put them in categorical in the same name but in different numbers. for example .
clear all
clc
A1=[1:10]; % has to be in the first of categorical
B1=[11:20]; % has to be in the second of categorical
A2=[21:30]; % has to be in the third of categorical
B2=[31:40]; % has to be in the fourth of categorical
A3=[41:50]; % has to be in the fifth of categorical
Psition=categorical({'A' 'B' 'A' 'B' 'A'});
thanks
  댓글 수: 2
Guillaume
Guillaume 2017년 11월 28일
I don't understand your question.
Psition=categorical({'A' 'B' 'A' 'B' 'A'});
creates a categorical variable that has only two possible values, the char array 'A' or the char array 'B'. That is completely independent of the variables you've created previously.
mohammed hussein
mohammed hussein 2017년 11월 29일
thank you for your replay , i mean the rang of A1=[1:10] has to be in first A in categorical under name A. the B1=[11:20] has to be the second in categorical in name B . the A2=[21:30] has to be in third of categorical in name A and . the B2=[31:40] has to be in forth in categorical in name B and so on for another .

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

채택된 답변

Walter Roberson
Walter Roberson 2017년 11월 28일
편집: Walter Roberson 2017년 11월 29일
  댓글 수: 2
mohammed hussein
mohammed hussein 2017년 11월 29일
편집: mohammed hussein 2017년 11월 29일
Thanks . can you explain to me how can i use dicretize to get categorical results on my data.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Categorical Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by