Encounter an error while using fimplicit?

3 Ansichten (letzte 30 Tage)
Wajahat am 16 Apr. 2020
Kommentiert: Star Strider am 16 Apr. 2020
How to plot the following equation on matlab by using fimplicit?
(x-x0).*conj((x-x0))+(y-y0).^2=r^2
close all;
r=1./2;
x0=0;
y0=1./2;
syms x y
fimplicit((x-x0).*conj((x-x0))+(y-y0).^2-r^2)
axis equal
Matlab shows
'Undefined function or variable 'fimplicit'.'
0 Kommentare-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Star Strider am 16 Apr. 2020
The fimplicit function was introduced in R2016b.
r=1./2;
x0=0;
y0=1./2;
f = @(x,y) (x-x0).*conj((x-x0))+(y-y0).^2-r^2;
xv = linspace(x0-r, x0+r, 25);
yv = linspace(y0-r, y0+r, 25);
[X,Y] = ndgrid(xv,yv);
figure
contour(X,Y,f(X,Y), [0 0])
grid
axis equal
.
6 Kommentare5 ältere Kommentare anzeigen5 ältere Kommentare ausblenden
Star Strider am 16 Apr. 2020
Adjust the limits of ‘xv’ (and perhaps also ‘yv’) to match the figure you want.
For example:
xv = linspace(-1, 1, 25);
You may need to change the parameters in the ‘f’ function to exactly reproduce the figure you posted.

Melden Sie sich an, um zu kommentieren.

Kategorien

Find more on Surface and Mesh Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by