I want to retrieve every data from my table (as atachment) in column red and green

조회 수: 2 (최근 30일)
I want to retrieve every data from my table (as atachment) in column red and green....and compare to one value (as condition) and counter if value correct for the condition.....do you have any suggesstion code?...tq

채택된 답변

Geoff Hayes
Geoff Hayes 2015년 2월 12일
Mimie - see xlsread for how you can read in the data from the spreadsheet, and in particular, the red and green columns. For your case, you may want to do something like
filename = 'microarrayMimie.xls';
firstPair = xlsread(filename,'E:F');
secondPair = xlsread(filename,'H:I')
where you read in two columns at a time, those in E and F, and those in H and I.
Your next step is that you want to compare to one value. Please elaborate - which elements of the columns are you comparing, and to what?
  댓글 수: 3
Mimie Basha
Mimie Basha 2015년 2월 15일
i want to compare all value in column H with value 100....if value H exceed value 100, counter will increase 1.. :)
lastly, result i need is total of counter. :)
Geoff Hayes
Geoff Hayes 2015년 2월 15일
Mimie - see the find for how you can determine which elements of your vector exceed some threshold. For example, if hData is your column H and you wish to know how many elements exceed 100 then
find(hData>100)
will return all row indices of hData whose element is greater than 100. Now use length to determine how many rows of hData exceed this threshold
length(find(hData>100))

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by