Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Matrix dimensions must agree.
Posted:
Mar 20, 2014 3:42 PM


dpb <none@non.net> wrote in message <lgfaqk$820$1@speranza.aioe.org>... > On 3/20/2014 12:57 PM, Vitor Andrade wrote: > ... > > > I don't understand you. I would like to delete the row that is left > > over. Is there anyway? I want to implement this on my code. > > Which specific row is the "leftover" one? First, last, some other based > on some value...? > > But, sure...that's one of the ways to implement option B  > > Assume two arrays are x and y and it's the last row to eliminate in the > longer array... > > lenx=length(x); > leny=length(y); > if lenx>leny > x(leny+1:end)=[]; > elseif > if leny>lenx > y(lenx+1:end)=[]; > end > > It might be simpler to prevent the two arrays from being different > length to begin with but that depends on how they're created. > >  > Thanks Sr, for your attention! Your code was used! Thanks again! >



