A\b doesn't work

15 views (last 30 days)
Dawid
Dawid on 7 Dec 2013
Commented: Image Analyst on 25 Mar 2014
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 Comment
Image Analyst
Image Analyst on 25 Mar 2014
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.

Sign in to comment.

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 7 Dec 2013
Edited: Azzi Abdelmalek on 7 Dec 2013
b is a column vector
b=b'
x=A\b

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!