主题: MATLAB心曲线
查看单个帖子
旧 2019-12-10, 20:41   #1
poster
高级会员
 
注册日期: 2019-11-21
帖子: 3,006
声望力: 66
poster 正向着好的方向发展
帖子 MATLAB心曲线

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

替代文字http://www.freeimagehosting.net/uploads/94020b921d.gif

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

我得到的错误是;

>> 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. 更新

即使这样也没有用!

>> 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.

回答:

我想知道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

更多&回答...
poster 当前离线   回复时引用此帖