MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   MATLAB心曲线 (https://www.labfans.com/bbs/showthread.php?t=23358)

poster 2019-12-10 20:41

MATLAB心曲线
 
我正在尝试在MATLAB中获得此功能,但是我没有成功!那里有MATLAB专家吗?

[URL="http://www.freeimagehosting.net/uploads/94020b921d.gif"]替代文字http://www.freeimagehosting.net/uploads/94020b921d.gif[/URL]

我想简单的命令应该可以工作,可能不需要程序。

我得到的错误是;

>> t = -pi:0.1:pi; >> r = ((sin(t)*sqrt(cos(t)))*(sin(t) + (7/5))^(-1)) - 2*sin(t) + 2 ; ??? Error using ==> mtimes Inner matrix dimensions must agree. [B]更新[/B]

即使这样也没有用!

>> t = -pi:0.1:pi; >> r = ((sin(t).*sqrt(cos(t))).*(sin(t) + (7/5)).^(-1)) - 2*sin(t) + 2 ; >> plot(r,t) ??? Error using ==> plot Vectors must be the same lengths.

[B]回答:[/B]

我想知道plot是否是正确的命令。我尝试了这个:

ezpolar('((sin(t).*sqrt(cos(t))).*(sin(t) + (7/5)).^(-1)) - 2*sin(t) + 2') 并且几乎得到了OP正在寻找的图表。我怀疑OP可能会做得更好polar 。尝试plot(r,t)给了我一个在(x,y)空间中的弯曲和警告:

Warning: Imaginary parts of complex X and/or Y arguments ignored

[url=https://stackoverflow.com/questions/2720180]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 05:08

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.