How to use If elseif else in array ?
Show older comments
I have variables of the image call 'IGray' in picture below

now I want to write the if elseif code to find amount of the value that I separate in 3 ways
- the value < 50
- the value 50-220
- the value > 220
primary, I try to write but it can not . As shown below
which I want ThW, ThWB and ThB show in the workspaces and it can double click to show all variables.

Please help me TT
Thank you very much ^^
3 Comments
Omer Yasin Birey
on 6 Feb 2019
" I want ThW, ThWB and ThB show in the workspaces and it can double click to show all variables"
Are these 'ThW, ThWB, ThB' some variables. And do you want to display them for each of the IGray variable that satisfies the condition?
Steven Lord
on 6 Feb 2019
Do you want to display ThW in the Command Window once if any of the elements in Threshold_IGray is greater than or equal to 220, once if all the elements in Threshold_IGray is greater than or equal to 220, or a number of times equal to the number of elements in Threshold_IGray that are greater than or equal to 220? You're likely to get a different number of ThW's displayed in each of those three scenarios.
Ajaree Rattanaharn
on 7 Feb 2019
Accepted Answer
More Answers (0)
Categories
Find more on Performance and Memory in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!