フィルターのクリア

Warning: Negative data ignored

83 ビュー (過去 30 日間)
Bharat
Bharat 2013 年 4 月 5 日
I want to know how to plot negative value. I have imported data from excel file to plot in matlab. In data i have negative value but i can't able to see graph at negative value.
Plz help to find solution. And how to do to see negative curve.
plot(freq,x);hold all;plot(freq,y);hold off;figure(gcf);
Warning: Negative data ignored
Warning: Negative data ignored

回答 (3 件)

Tom Lane
Tom Lane 2013 年 4 月 6 日
Could you have already had "hold on" in effect for a plot with log axes? The following commands illustrate what I mean:
semilogy(rand(10,1),rand(10,1),'bo') % you could get the error by doing this,
hold on % then turning hold on,
plot(rand(10,1),randn(10,1),'rx') % <- if your code fragment started here

Image Analyst
Image Analyst 2013 年 4 月 5 日
Try using "hold on" instead of "hold all".
  2 件のコメント
Jan
Jan 2013 年 4 月 5 日
Why? "hold all" cares about the color order also, as far as I remember.
Image Analyst
Image Analyst 2013 年 4 月 5 日
I thought that maybe hold all would lock down the Y axis limits and then if you tried to plot y outside of those limits, then it might not be able to plot some. It was just a guess.

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


Jan
Jan 2013 年 4 月 5 日
編集済み: Jan 2013 年 4 月 5 日
The shown code works with negative values also:
freq = 1:10;
x = linspace(-5, 5, 10);
y = linspace(5, -5, 10);
plot(freq,x);
hold('all');
plot(freq,y);
hold('off');
figure(gcf);
Therefore something else must be going wrong. Perhaps you have set any properties or other GUI obejcts to invalid values before, e.g. the 'Value' of an uicontrol to -1. Please post the relevant part of the code then.

カテゴリ

Help Center および File ExchangeGraphics Object Identification についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by