my matlab is showing error in (line 5) subplot(1,2,1) %Create a left subplot in the below function. what's the solution??
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
jaskaran singh
am 15 Mai 2017
Kommentiert: jaskaran singh
am 18 Mai 2017
a = -2:0.2:2; %Creating a vector a with 21 elements
[x, y] = meshgrid(a, a); %Creating x and y as a meshgrid of a
z = exp (-x.^2 - y.^2); %Take the 2-dimensional exponential of x and y
figure %Open a new figure
subplot(1,2,1) %Create a left subplot
mesh(z) %Draw a wire mesh plot of the data in z
subplot(1,2,2) %Create a right subplot
surf(z) %Draw a surface plot of the data in z
1 Kommentar
Akzeptierte Antwort
Megha Parthasarathy
am 17 Mai 2017
Hello,
It is working fine. I see the below figure.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176293/image.png)
What is the error that you see?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Subplots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!