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

12 visualizzazioni (ultimi 30 giorni)
S.R.
S.R. il 20 Feb 2017
Risposto: Walter Roberson il 20 Feb 2017
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

Risposte (2)

KSSV
KSSV il 20 Feb 2017
Modificato: KSSV il 20 Feb 2017
[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 il 20 Feb 2017
You have
Y. +
notice the dot before the space before the +

Categorie

Scopri di più su Get Started with Curve Fitting Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by