x = linspace(-10,10 ,51)'; y = linspace(0,0.3,51)'; [X, Y] = meshgrid(x, y); Z=X/(1+Y); surf(X, Y, Z); ylabel('t'); xlabel('x'); zlabel('u(x,t)').this is showing error .Now I want to know that the z=f(x)/g(x) why the code is not running
28 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
x = linspace(-10,10 ,51)';
y = linspace(0,0.3,51)';
[X, Y] = meshgrid(x, y);
Z=x/(1+y);
surf(X, Y, Z);
ylabel('t');
xlabel('x');
zlabel('u(x,t)')
It is showing error that matrix is singular and graph display is balnk. What is mistake with this code.Here in place of X it should be x is it so.
%%%%%%%%%%%%%%%%
Problem : What is wrong in this code
x = linspace(0,1 ,51)';
y = linspace(0,1,51)';
[X, Y] = meshgrid(x, y);
Z=exp(-4.*(pi^2)*0.5*Y)*sin(2*pi*X);
surf(X, Y, Z);
ylabel('t');
xlabel('x');
zlabel('u(x,t)')
Its not showing correct graph
[SL: updated formatting to extract text from the code block.]
2 Kommentare
Antworten (1)
Star Strider
am 4 Jun. 2017
We have been through this before https://www.mathworks.com/matlabcentral/answers/343230-i-wrote-the-code-to-plot-two-dimension-graph-but-it-is-not-showing-the-correct-graph-so-can-you-chec#answer_269488, and I even provided a link to the documentation in my Answer.
YOU NEED TO USE ELEMENT-WISE OPERATIONS!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices 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!