how to make a variable take the smallest value

Hello, how could i make a variable in plot take the smallest value and another question how can i set another value of origin .. i want to plot as this figure
and this is my code
hold on
if r==0 && w>0
B=B+w;
plot(B,A,'k:')
elseif r==0 && w<0
B=B+w;
plot(B,A,'g:')
else
plot(B,A,'m:')
end
hold off
but here the origin is not the same ( if r==0) and thanks

 採用された回答

Walter Roberson
Walter Roberson 2015 年 5 月 16 日

0 投票

What do you mean by "take the smallest value" ? Is the above code being run in a loop and might plot several points close together and you want the result to be coloured according to the color scheme appropriate for the minimum the variable is for each of the samples in the region?

3 件のコメント

kimo lassay
kimo lassay 2015 年 5 月 16 日
thak you for replying, what i mean when i change the value of "w" for exp. if i take the first time 0.1 and second time 0.2 and other 0.3 i want it to take the value ~0.11or0.15
Walter Roberson
Walter Roberson 2015 年 5 月 16 日
How does the 0.11 or 0.15 relate to 0.1, 0.2, 0.3 ?
If you have a list of the w you have used, say in wlist, then
smallest_w = min(wlist);
kimo lassay
kimo lassay 2015 年 5 月 18 日
Thank you very much walter

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by