assign summary of a category to new variables
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Peng
am 6 Apr. 2015
Bearbeitet: Sean de Wolski
am 6 Apr. 2015
Hi everyone,
I have the following code:
A = categorical({'plane'; 'car'; 'train'; 'car'; 'plane'});
summary(A)
here is the output:
>> Untitled
car 2
plane 2
train 1
I want to assign the summary to a new variable. So I tried using b=summary(A), and got:
>> Untitled
Error using categorical/summary (line 98)
Too many output arguments.
Error in Untitled (line 2)
b=summary(A)
please help me fix this problem
Thanks
Peng
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Sean de Wolski
am 6 Apr. 2015
Bearbeitet: Sean de Wolski
am 6 Apr. 2015
Or
c = categorical({'plane'; 'car'; 'train'; 'car'; 'plane'})
b = table(categories(c),countcats(c))
0 Kommentare
Siehe auch
Kategorien
Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!