The Math Forum

Search All of the Math Forum:

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

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

Topic: Matrix dimensions must agree.
Replies: 13   Last Post: Mar 24, 2014 5:34 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Vitor Andrade

Posts: 12
Registered: 3/18/14
Re: Matrix dimensions must agree.
Posted: Mar 20, 2014 1:57 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <> wrote in message <lgf8jc$vlq$>...
> On 3/20/2014 12:22 PM, Vitor Andrade wrote:
> > I'm new programmer, so I need to help of you.
> >
> > I have two matrices, wherein I would like to subtract one from the other:
> >
> > Comprimento = pe2(:,2) - pe1(:,2);
> > But, my arrays are sizes different, one the size 11x2 and other the size
> > 12x2. However, I would like to delete the row where my error occurs and
> > continue my calculations.
> >
> > I hope I have to been clearer.

> A) Enclose the error-throwing code in a try...catch block
> B) Use "defensive programming" and test for the size mismatch and either
> don't execute the known-to-fail code or fixup the size mismatch so it
> doesn't fail.
> --

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.

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.