フィルターのクリア

shade area under curve between 2 x-axis limits

9 ビュー (過去 30 日間)
monkey_matlab
monkey_matlab 2015 年 7 月 26 日
編集済み: Azzi Abdelmalek 2015 年 7 月 26 日
For the code below:
x=0:pi/50:2*pi;
y1=x.^2;
baseval1=20;
baseval2=3;
clf;
H1=area(x,y1,baseval1);
H=area(x,y1);
set(H(1),'FaceColor',[1 0.5 0]);
how do I shade the area under the curve just between x = 3 to x = 4?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 26 日
編集済み: Azzi Abdelmalek 2015 年 7 月 26 日
x=0:pi/50:2*pi;
y1=x.^2;
H1=area(x,y1);
hold on
idx=x>3&x<4;
H=area(x(idx),y1(idx));
set(H(1),'FaceColor',[1 0.5 0]);
Or
close
x=0:pi/50:2*pi;
y1=x.^2;
%baseval1=20;
%baseval2=3;
%clf;
H1=area(x,y1,'FaceColor',[1 1 1]);
hold on
idx=x>3&x<4;
H=area(x(idx),y1(idx));
set(H(1),'FaceColor',[1 0.5 0]);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMotor Drives についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by