Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]()
就是这个问题銆/ p> 为什么这两个解决方案不起作用,尽管对我来说看起来很有效:
>> 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. 上面有什么问题? 回答: *运算符是矩阵乘法运算符,它要求其操作数具有匹配的内部矩阵维。 .*运算符是逐元素的乘法运算符,它要求其操作数具有相同的大小(或一个为标量),以便可以对每个匹配的元素对执行乘法。有关更多详细信息,请参见此链接 。 另外,当我运行第二个解决方案时,我没有得到绘制错误。我刚收到以下警告: Warning: Imaginary parts of complex X and/or Y arguments ignored 更多&回答... |
![]() |
![]() |