Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
if error

Subject: if error

From: Danielle Leblanc

Date: 18 Aug, 2010 13:21:23

Message: 1 of 3


Ids there a possibility to change the codes if I receive an error. For example
A=B; (assume here I receive an error)

if error

A=C;
end

is ther anything similar to this in matlab ?

Subject: if error

From: Sean

Date: 18 Aug, 2010 13:28:05

Message: 2 of 3

"Danielle Leblanc" <danielleblanc2004@hotmail.com> wrote in message <i4gmoj$9aq$1@fred.mathworks.com>...
>
> Ids there a possibility to change the codes if I receive an error. For example
> A=B; (assume here I receive an error)
>
> if error
>
> A=C;
> end
>
> is ther anything similar to this in matlab ?

help try
help catch
help error

Subject: if error

From: Torsten Hennig

Date: 18 Aug, 2010 13:42:39

Message: 3 of 3

>
> Ids there a possibility to change the codes if I
> receive an error. For example
> A=B; (assume here I receive an error)
>
> if error
>
> A=C;
> end
>
> is ther anything similar to this in matlab ?

Most MATLAB programs return error codes.
So you can check the error code and program an
if-statement accordingly.

Best wishes
Torsten.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us