Hi
what is happening here:
close all
x = -1 : 0.1 : 5;
y = x;
[X, Y] = meshgrid(x,y);
Z = 2*X - X*Y + 2*Y;
surf(X, Y, Z)
xlabel('Ox')
ylabel('Oy')
zlabel('Oz')

 채택된 답변

Ravi Narasimhan
Ravi Narasimhan 2021년 10월 2일
편집: Ravi Narasimhan 2021년 10월 2일

0 개 추천

Did you intend to do an element-by-element multiply on X and Y?
close all
x = -1 : 0.1 : 5;
y = x;
[X, Y] = meshgrid(x,y);
Z = 2*X - X.*Y + 2*Y; % Note the .*
surf(X, Y, Z)
xlabel('Ox')
ylabel('Oy')
zlabel('Oz')

추가 답변 (0개)

카테고리

태그

질문:

2021년 10월 2일

편집:

2021년 10월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by