Plus sign is adding error to code?? Help Please??

11 ビュー (過去 30 日間)
S.R.
S.R. 2017 年 2 月 20 日
回答済み: Walter Roberson 2017 年 2 月 20 日
Here is the code i am using. I was able to fix it however, now its highlighting the plus sign as an error. Can anybody help?? The original function is:
F(x,y)=xy-lnx-y^2/2+C
%
[X,Y] = meshgrid(-3:.01:3, -4:.01:4);
contour(X, Y, ((X.*Y. + ln(X.)+((Y.^2)./2))))
hold on

回答 (2 件)

KSSV
KSSV 2017 年 2 月 20 日
編集済み: KSSV 2017 年 2 月 20 日
[X,Y] = meshgrid(-3:.01:3, -4:.01:4);
Z = ((X.*Y + log(X)+((Y.^2)./2))) ; % Z is complex check
contour(X, Y,real(Z) )
There is .+, only +.

Walter Roberson
Walter Roberson 2017 年 2 月 20 日
You have
Y. +
notice the dot before the space before the +

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by