How can I plot a filled rectangle as a backdrop for a desired target?

조회 수: 1 (최근 30일)
Michael Kobylarek
Michael Kobylarek 2015년 3월 26일
I have two datasets, one of which is a target position, and the other is the actual position. I would like to plot the target with a +/- acceptable range and then overlay with the target.
I have unsuccessfully attempted the built in area, fill, and rectangle functions.
For example
y = [1 1 1 2 1 1 3 3 1 1 1 1 1 1 1]; % Target datum
y1 = y+1; %variation in target size
y2 = y-1;
t = 1:15;
X=[t,fliplr(t)]; %create continuous x value array for plotting
Y=[y1,fliplr(y2)]; %create y values for out and then back
fill(X,Y,'b');
The image produced looks like this
I would prefer it to be filled within the red boxes drawn on here

답변 (0개)

카테고리

Help CenterFile Exchange에서 Design Condition Indicators Interactively에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by