edit-counting the numbers

I have some value in a dataset
raw=
>50K
>=50K
>50K ;
;
;
;
;
<=50K
A=sum( strcmp('>50K', raw) )
A2=sum( strcmp('<=50K', raw) )
BUT I GET A ,A2 as zero ,such that i have 32000 rows

7 件のコメント

Image Analyst
Image Analyst 2012 年 1 月 25 日
Because this doesn't make any sense to me, I think you need to check this out: http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
kash
kash 2012 年 1 月 25 日
Can say which do not make sense
kash
kash 2012 年 1 月 25 日
In that i want to count how many values of >50k,>=50K are there
TAB
TAB 2012 年 1 月 25 日
What is "raw" ? Is it a cell array ?
kash
kash 2012 年 1 月 25 日
raw=
'>50K'
'<=50K'
;
;
;
'>50K'
TAB
TAB 2012 年 1 月 25 日
I don't know what is "raw" and what is it's dimensions.
But try
A=sum(strcmp('>50K', raw{1}))
A2=sum(strcmp('<=50K', raw{1}))
Walter Roberson
Walter Roberson 2012 年 2 月 4 日
raw is the third output from an xlsread()

サインインしてコメントする。

回答 (1 件)

Sven Schoeberichts
Sven Schoeberichts 2012 年 1 月 25 日

0 投票

I still don't know if you have strings in that dataset or values, but this should give you a starting point:
length( find( dataset == value ))

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

タグ

質問済み:

2012 年 1 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by