figure()
%Draw the rectangle first
rectangle('Position',[3 3 3 3],'FaceColor',[1 0 0]);
%hold on - to add the plot to the same figure on top of the rectangle
hold on
%Then plot the curve
plot(1:10); % Plots the line
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!