I have a table that contains score of mental health staus per indvidual
I would like to create vector to store the each indvidual status whether it is good or bad.
I have create the following condition
score=sdq;
count=0;
for k=1:length(score)
if score(k)>17;
count=count+1;
end
end
it works well , however, Im looking to store the new out put in a new coloumns showing the condition of good or bad mental health status

 Accepted Answer

isGood = score > 17; % isBad?

4 Comments

Thanks It works
how can I present that in a graph
Adam Danz
Adam Danz on 29 May 2020
Edited: Adam Danz on 29 May 2020
What are you plotting?
Do you want to show the number of TRUE and FALSE values?
histogram(isGood)
or
bar(sum(isGood),sum(~isGood))
Thank alot
Glad I could help.

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots 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!