Hello!
My idea is to plot three graphs in the same same figure using nexttile, and while the plots do show, the functions within them ends up being just empty rectangles with their respective names above them. I'm quite new with Matlab, so any help would be appreciated, even just a slight push in the right direction. :)
Thank you!
See code below:
x = linspace(-2.5,2.5,10);
y1 = x/(x.^2+1);
y2 = (1/3)(x/(1+(1/9)*x.^2));
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

Error in connector.internal.fevalMatlab

Error in connector.internal.fevalJSON
y3 = -1/2(x/(1+(1/4)*x.^2));
tiledlayout(3,1)
nexttile
plot(x,y1)
title('Plot 1')
nexttile
plot(x,y2)
title("Plot 2")
nexttile
plot(x,y3)
title("Plot 3")

1 Kommentar

Matt J
Matt J am 7 Okt. 2021
Your post now shows the result of running your code (I took the liberty). It never makes it past the first 4 lines, as you can see.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matt J
Matt J am 7 Okt. 2021

0 Stimmen

If I make some guesses as to what operations you really intended,
x = linspace(-2.5,2.5,10);
y1 = x./(x.^2+1);
y2 = (1/3)*(x./(1+(1/9)*x.^2));
y3 = -1/2*(x./(1+(1/4)*x.^2));
tiledlayout(3,1)
nexttile
plot(x,y1)
title('Plot 1')
nexttile
plot(x,y2)
title("Plot 2")
nexttile
plot(x,y3)
title("Plot 3")

Kategorien

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

Gefragt:

am 7 Okt. 2021

Beantwortet:

am 7 Okt. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by