"Halley " <firstname.lastname@example.org> wrote in message news:email@example.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.
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.