Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Matrix Dimensions must agree.
Replies: 1   Last Post: Feb 12, 2013 11:33 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  

Posts: 2,357
Registered: 12/6/04
Re: Matrix Dimensions must agree.
Posted: Feb 12, 2013 11:33 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Erik" wrote in message <kfdpbk$kdp$1@newscl01ah.mathworks.com>...
> I have this:
> t= [0:100];
> L = 100;
> k = [.1 .3 .7];
> C = 25;
> i want to multiply
> -k .* t
> but i get an error message saying matrix dimensions must agree.
> I thought the . before the * would get rid of that error but it doesn't. what is going on???

Well, k has 3 elements and t has 101.

How do you expect the results to look like by multiplying 3 things by 101 things?

Do you want an array of 3X101 or 101X3 perhaps?

Maybe something like:


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2015. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.