MATLAB心曲线 [英] MATLAB Heart Curve
本文介绍了MATLAB心曲线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在MATLAB中获得它,但是我没有成功!那里有MATLAB专家吗?
I am trying to get this in MATLAB, however I am not successful ! Any MATLAB gurus out there ?
替代文本http://www.freeimagehosting.net/uploads/94020b921d.gif
我想简单的命令应该可以工作,可能不需要程序.
I guess simple commands should work, a program may not be needed.
我得到的错误是;
>> 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
是否是正确的命令.我试过了:
I wonder whether plot
is the right command for this. I tried this:
ezpolar('((sin(t).*sqrt(cos(t))).*(sin(t) + (7/5)).^(-1)) - 2*sin(t) + 2')
几乎得到了OP正在寻找的图表.我怀疑OP使用polar
可能会做得更好.尝试plot(r,t)
给了我一个在(x,y)空间中的弯曲字样和一个警告:
and almost got the diagram OP is looking for. I suspect OP might do even better with polar
. Trying plot(r,t)
gave me a squiggle in (x,y) space and a warning:
Warning: Imaginary parts of complex X and/or Y arguments ignored
这篇关于MATLAB心曲线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文