A\b doesn't work

15 次查看(过去 30 天)
Dawid
Dawid 2013-12-7
I have a problem in working with the matrix.
This is my script:
A=[0 0 0 0 0 0; 2.05^4 2.05^3 2.05^2 0 0 0; 3.1^4 3.1^3 3.1^2 0 0 0; 4.8^4 4.8^3 4.8^2 0 0 0; 5.6^4 5.6^3 5.6^2 0 0 0; 6.8 ^4 6.8^3 6.8^2 0 0 0]
b=[0 2.47 6.1 18.3 27.4 36.6]
x=A\b
This is the error messsage I get from Matlab:
??? Error using ==> mldivide Matrix dimensions must agree.
Error in ==> nad at 3 x=A\b
How I can solve this problem?
Thanks You very much.
  1 个评论
Image Analyst
Image Analyst 2014-3-25
Original question in case he deletes it like he's done with others.
I have a problem in working with the matrix.
This is my script:
A=[0 0 0 0 0 0; 2.05^4 2.05^3 2.05^2 0 0 0; 3.1^4 3.1^3 3.1^2 0 0 0; 4.8^4 4.8^3 4.8^2 0 0 0; 5.6^4 5.6^3 5.6^2 0 0 0; 6.8 ^4 6.8^3 6.8^2 0 0 0]
b=[0 2.47 6.1 18.3 27.4 36.6]
x=A\b
This is the error messsage I get from Matlab:
??? Error using ==> mldivide Matrix dimensions must agree.
Error in ==> nad at 3 x=A\b
How I can solve this problem?
Thanks You very much.

请先登录,再进行评论。

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2013-12-7
编辑:Azzi Abdelmalek 2013-12-7
b is a column vector
b=b'
x=A\b

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by