if condition for counting
11 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have a list of numbers(double type stored in a variable. I want to see when a number is greater than '4', how can I disply that number.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/523397/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/523397/image.png)
0 件のコメント
回答 (2 件)
KALYAN ACHARJYA
2021 年 2 月 18 日
編集済み: KALYAN ACHARJYA
2021 年 2 月 18 日
To display numbers more than 4, here var is the variable name of given data
num_data=var(var>4)
To count the numbers, which are more than 4
count_data=sum(var>4)
0 件のコメント
Waseem AL Aqqad
2021 年 2 月 18 日
編集済み: Waseem AL Aqqad
2021 年 2 月 18 日
B=randi(10,1,815);
idx=find(B>4);
B(idx);
3 件のコメント
Waseem AL Aqqad
2021 年 2 月 19 日
By the way it's good to accept volunteers' answers if it helped you. Actually, You never did that as I can see from your MATLAB Answers profile.
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!