clear
clc
[X,Y]=meshgrid(log(5*10.^5):100000:log(10.^7),log(0.6):10:log(2000));
Z=log(((0.037.*(X.^0.8).*Y)/(1+(2.443.*X.^-0.1).*((Y.^2/3)-1))));
mesh(X,Y,Z);
grid on
hold on

댓글 수: 5

madhan ravi
madhan ravi 2018년 7월 22일
Because x and y has to be vectors.
Aquatris
Aquatris 2018년 7월 22일
The expression
log(5*10.^5):100000:log(10.^7)
gives a scalar. I think you defined your x and y range wrong.
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 22일
There should be one variable, Its creates the vector.
Jan
Jan 2018년 7월 22일
편집: Jan 2018년 7월 22일
@Hazwan Arief: I've formatted your code today. Please use the "{} Code" button in the future.
Whenever you get an error message, post it in the forum to show the readers, why you assume that there is something wrong.
Error using mesh (line 83)
Z must be a matrix, not a scalar or vector.
Are you aware that Y.^2/3 is (Y.^2) / 3?
Hazwan Arief
Hazwan Arief 2018년 7월 22일
Noted. Thank you for the input. I'll take note of it in future posts.

댓글을 달려면 로그인하십시오.

 채택된 답변

Jan
Jan 2018년 7월 22일
편집: Jan 2018년 7월 22일

2 개 추천

figure
axes
xv = linspace(log(5e5), log(1e7), 100);
yv = linspace(log(0.6), log(2000), 100);
[X, Y] = meshgrid(xv, yv);
Z = log(((0.037 .* (X.^0.8) .* Y) ./ (1 + (2.443 ./ (X .^ 0.1)) .* ((Y .^ (2/3))-1))));
% Guessed: ^ ^ ^
% Simplified (reduce parentheses):
% Z = log(0.037 .* (X.^0.8) .* Y ./ (1 + 2.443 ./ (X .^ 0.1) .* (Y .^ (2/3) - 1)))
mesh(X, Y, real(Z)); % Z is complex!
grid on

댓글 수: 2

Hazwan Arief
Hazwan Arief 2018년 7월 22일
Works thanks a lot.
Image Analyst
Image Analyst 2018년 7월 22일
Please accept Jan's answer to give him credit for it. Thanks in advance.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 NaNs에 대해 자세히 알아보기

태그

질문:

2018년 7월 22일

댓글:

2018년 7월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by