필터 지우기
필터 지우기

Encounter an error while using fimplicit?

조회 수: 3 (최근 30일)
Wajahat
Wajahat 2020년 4월 16일
댓글: Star Strider 2020년 4월 16일
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'.'

채택된 답변

Star Strider
Star Strider 2020년 4월 16일
The fimplicit function was introduced in R2016b.
Use the contour function instead:
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
Wajahat
Wajahat 2020년 4월 16일
I got this
which is not same as the previous attached hyperboic image
Star Strider
Star Strider 2020년 4월 16일
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.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by