How to plot two matrices with multiple conditions on same graph?

12 ビュー (過去 30 日間)
Tien T
Tien T 2014 年 8 月 6 日
コメント済み: Tien T 2014 年 8 月 7 日
How would I be able to plot two matrices on the same plot given that they must satisfy two conditions?
Below is the code that I tried to implement this. numDetnARR and numFAARR are [836 x 1] vectors and probFAARReshape and probDetnARRReshape are [76 x 11] matrices.
Running this gave the error, 'Operands to the and && operators must be convertible to logical scalar values.' because of the line
if (numDetnARR < maxDetn) && (numDetnARR > minDetn)
and
if (numFAARR < maxFA) && (numFAARR > minFA)
I'm not sure how to fix these.
Plot for minimum threshold values of detection and FA
maxDetn = 5000;
minDetn = 10;
boolDetn = 0;
if (numDetnARR < maxDetn) && (numDetnARR > minDetn)
boolDetn = 1;
end
maxFA = 5000;
minFA = 10;
boolFA = 0;
if (numFAARR < maxFA) && (numFAARR > minFA)
boolFA = 1;
end
minFA = numFAARR >= 10;
plot(probFAARRReshape(boolFA == 1),probDetnARRReshape(boolDetn == 1),'r');
This isn't very efficient but as simple as I come with. Could someone help me with this?
  1 件のコメント
Andrew Reibold
Andrew Reibold 2014 年 8 月 6 日
Left out some of the variable definitions for us to run / debug, but we could make stuff up I guess.

サインインしてコメントする。

回答 (1 件)

Andrew Reibold
Andrew Reibold 2014 年 8 月 6 日
編集済み: Andrew Reibold 2014 年 8 月 6 日
Try using & instead of &&
Do you get the same problem?
  3 件のコメント
Andrew Reibold
Andrew Reibold 2014 年 8 月 7 日
What do you mean when you say "it says its not plotting anything" Is 'Matlab' 'it'? What is 'it' saying?
Is an error being generated? Or are you personally identifying that, clearly, there is no plot! lol
Tien T
Tien T 2014 年 8 月 7 日
So MATLAB is showing the following warning in the command window:
Warning: Plot empty.
> In legend at 286
So yes, I am trying to tell you that there is no plot generated from the code I used. Sorry for the confusion haha.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by