Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Need help understanding matlab vectors?

조회 수: 2 (최근 30일)
Dustin
Dustin 2014년 7월 21일
마감: MATLAB Answer Bot 2021년 8월 20일
Can someone HELP me UNDERSTAND how "I" would go about answering some questions like the ones listed below, "WITHOUT" JUST GIVING ME THE ANSWERS? maybe just a basic vector tutorial. FEEL FREE TO MAKE YOUR OWN EXAMPLES IF THAT'S EASIER.
ok so suppose you have 5 variables BP(blood pressure)normal BP is under 70BPM, race('b','w','h'), age, gender-('male' and 'female'), and BPLabs(A,B,C)-lab a,lab b, lab c. 50 patients, each patient had 10 tests done example questions.. in terms of matlab code
1.total# of normal BP's
2. # of men in the cohort
3. # of measurements that lab A made
4. number of 'w' females in the study
5. # of black men who are above the age of 30
6. code to find the BP form lab C
7. BP's from males age 50-65
8. max BP measurements in everyone above the age of 50
  댓글 수: 5
Rick Rosson
Rick Rosson 2014년 8월 23일
Above all else, please STOP USING ALL CAPS TO ADD EMPHASIS. Try using bold or italics instead. Thanks!
Jan
Jan 2014년 8월 23일
@Dustin: UPPERCASE means shouting in internet forums.

답변 (1개)

Image Analyst
Image Analyst 2014년 8월 23일
Look up in the help the functions max(), min(), find(), sum(), and ismember(). Then look up logical indexing and how to threshold to select indexes:
logicalSelectedIndexes = yourData > lowValue & yourData < highValue;
selectedData = yourData(logicalSelectedIndexes);
That will be enough to solve everything you listed.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by