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: 7   Last Post: Oct 20, 2011 2:30 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: Matrix dimensions must agree
Posted: Oct 20, 2011 11:42 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"Halley " <halleykholmes@gmail.com> wrote in message
news:j7pdmt$3o9$1@newscl01ah.mathworks.com...
> I am trying to write a program that utilizes the inverse iterative method.
> I calculate an initial x value and rho value given the matrices A, B, and
> b. I calculate a value of x normalized to the matrix B (xnorm) as well as
> a new value for rho for each iteration. Given that the relative error of
> rho is less than my preset tolerance (TOL) the loop ends, otherwise xnorm
> becomes the new value for x and the rho(i+1) becomes rho(i). The problem
> is in calculating rho(i), I am told my matrix dimensions do not agree when
> I have checked the sizes multiple times. Any suggestions? Thanks.


Set an error breakpoint and run your code, then when you reach the line on
which MATLAB throws the error check the dimensions of the variables and
expressions that are being used on that line at that specific point in time.
If those dimensions are different than you expect, work your way back
through the code determining when the dimensions changed from what you
expect and then determine why.

http://www.mathworks.com/help/techdoc/matlab_env/brqxeeu-175.html#brqxeeu-242

If the line on which the error is thrown is in a loop, using a conditional
breakpoint (described earlier in the page to which I linked) to stop on a
particular line during a particular loop iteration may be of use to you as
you work your way backwards in your code to determine the root cause of the
dimension change.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com




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

[Privacy Policy] [Terms of Use]

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