Matlab Problem

1 view
Skip to first unread message

Amy Allen

unread,
Mar 19, 2010, 3:14:53 AM3/19/10
to math-285-fg...@googlegroups.com
Is anyone else getting an error about the matrix multiplication? I entered the multiplication as instructed, and it said that there was a dimension mismatch...I tried it with v first, and the answer I got doesn't solve the equations.

Rico Johnson

unread,
Mar 19, 2010, 11:12:14 AM3/19/10
to math-285-fg...@googlegroups.com
Hey Amy,

I received that error message as well.  The problem is that M^(-1) is not a Matlab command.  You have to enter it in as M' (M prime) so that it can transform the matrix for you.  I hope this is helpful.

On Fri, Mar 19, 2010 at 2:14 AM, Amy Allen <theinksta...@gmail.com> wrote:
Is anyone else getting an error about the matrix multiplication? I entered the multiplication as instructed, and it said that there was a dimension mismatch...I tried it with v first, and the answer I got doesn't solve the equations.

To unsubscribe from this group, send email to math-285-fg-spring-2010+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.



--
Rico Johnson
Sophomore| Industrial Engineering


Professor Laugesen

unread,
Mar 19, 2010, 1:33:11 PM3/19/10
to math-285-fg-spring-2010
Could you show me exactly what you typed? I just checked and the
command

c=M^(-1)*v

worked fine on my Matlab. Anyway, hope you got the problem done.


On Mar 19, 10:12 am, Rico Johnson <rjohns...@gmail.com> wrote:
> Hey Amy,
>
> I received that error message as well.  The problem is that M^(-1) is not a
> Matlab command.  You have to enter it in as M' (M prime) so that it can
> transform the matrix for you.  I hope this is helpful.
>

Rico Johnson

unread,
Mar 25, 2010, 7:30:37 PM3/25/10
to math-285-fg...@googlegroups.com
I typed c=M'*v and received a response.  When I typed c=M^(-1)*v, I couldn't get a response.

To unsubscribe from this group, send email to math-285-fg-spring-2010+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Ken Christensen

unread,
Mar 25, 2010, 10:49:56 PM3/25/10
to math-285-fg-spring-2010
Are you sure using M' works? When I did it, I used the \ operator,
i.e., c = M\v. When I tried using c = M^(-1)*v, it also worked, but c
= M'*v gave me a completely different (and incorrect) answer. Maybe
you used the wrong variables or typed it in wrong? Remember, v is a
column vector, made using v = [1;2;3;4....] or v = [1,2,3,4]' and M
is a vector containing all instances of your equations. For instance,
if you had A + 2B + 5D = 3, and 2A - B + C = 2, then you would create
the vectors like this; M = [1, 2, 0, 5; 2, -1, 1, 0] , v = [3;2] ,
and c=M\v or c = M^(-1)*v, giving you a column matrix with the values
A,B,C,D etc. in order downwards. Of course, you probably have more
equations than I gave, but the principal is the same. Hope this helps.

On Mar 25, 6:30 pm, Rico Johnson <rjohns...@gmail.com> wrote:
> I typed c=M'*v and received a response.  When I typed c=M^(-1)*v, I couldn't
> get a response.
>
> On Fri, Mar 19, 2010 at 12:33 PM, Professor Laugesen

> <lauge...@illinois.edu>wrote:

Reply all
Reply to author
Forward
0 new messages