MERGING OF MULTIPLE GRAPHS INTO ONE

1 Ansicht (letzte 30 Tage)
SULENDER SAHU
SULENDER SAHU am 2 Mär. 2022
Beantwortet: ag am 25 Sep. 2024
Is there any method to get a single graph from the above four graphs ? I have the data for individual graphs .

Antworten (1)

ag
ag am 25 Sep. 2024
Hi Sulender,
To plot multiple graphs on the same figure window, you can use the "hold on" command.
The below code snippet demonstrate how to achieve this using dummy data:
% Data for plotting
x = linspace(0, 2*pi, 100);
y1 = sin(x);
y2 = cos(x);
% First graph
figure; % Open a new figure window
plot(x, y1);
hold on
% Second graph
plot(x, y2);
xlabel('x');
legend('sin(x)', 'cos(x)');
title('Waves');
For more details, please refer to the following MathWorks documentation: Hold - https://www.mathworks.com/help/matlab/ref/hold.html
Hope this helps!

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by