Combine 2 shaded boundaries
Show older comments
I can create the shaded boundary (y1 and Y2) individually but I have issues merging the two codes together. The data file is attached and the code is shown below. Thank you.
data=load('Jun15_VelocityUV.txt');
b= data(:,1);
y=b(104:127,:);
% Input x-axis
x = linspace(1,24,24);
xi=1:0.01:24;
yi=interp1(x,y,xi,'spline');
h=plot(xi,yi)
% Define Limit
y1=0.6;
y2 = -0.6;
hold on
%area(xi, min(yi, y2), y2,'EdgeColor', 'none', 'FaceColor', [.7 .7 .7])
hold on
area(xi, max(yi, y1), y1, 'EdgeColor', 'none', 'FaceColor', [.7 .7 .7])
hold off


Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!