What's the difference between two way to input Matlab Complex Matrices

喜欢而已 提交于 2019-11-30 09:37:35

问题


Here's two ways to enter the command in Matlab. I don't think there's any difference between them. However, the result is really different. So I wonder what's I missed in this situation.

Here's the first input:

>> A = [(-0.025+0.01i) -0.025;
   3 (1-2i)];
>> B = [(5.7955+1.5529i) 0]';
>> I=inv(A)*B

The output is like this:

I =

   1.0e+02 *

  -0.7063 - 1.2723i
  -1.1030 + 1.6109i

Here's the second input:

>> A = [(-0.025+0.01i) -0.025;3 (1-2i)];
>> B = [(5.7955+1.5529i);0];
>> I=inv(A)*B

And the Matlab give me the result below:

I =

           2.44764705882354 -      145.499411764706i
          -176.067882352941 +      84.3624705882353i

I'm really confused about this situation. If you know anything please let me know about it. Thanks.


回答1:


Use B = [(5.7955+1.5529i) 0].' which is actually element-wise transpose and not B = [(5.7955+1.5529i) 0]' which is conjugate transpose.

One can also use an explicit call to transpose command - B = transpose([(5.7955+1.5529i) 0])



来源:https://stackoverflow.com/questions/23509241/whats-the-difference-between-two-way-to-input-matlab-complex-matrices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!