MATLAB Answers

A function that outputs multiple plots?

8 views (last 30 days)
alpedhuez
alpedhuez on 13 Aug 2020
Commented: alpedhuez on 13 Aug 2020

  4 Comments

Show 1 older comment
hosein Javan
hosein Javan on 13 Aug 2020
alpedhuez for example the function "step" plots step response of a system. or the function "spectrogram" plots the fourier transform spectrum.

Sign in to comment.

Accepted Answer

hosein Javan
hosein Javan on 13 Aug 2020
function plotoutput()
x = 1:10;
y = x.*x;
plot(x,y)
when you call the function, it shows a figure.

  3 Comments

alpedhuez
alpedhuez on 13 Aug 2020
Multiple plots, not just one!
hosein Javan
hosein Javan on 13 Aug 2020
function plotoutput()
x = 1:10;
y1 = x.*x;
y2 = x + 1;
figure(1);plot(x,y1)
figure(2);plot(x,y2)

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!