Thread Subject: Inf

Subject: Inf

From: Prashant Sandhi

Date: 23 Feb, 2010 14:35:19

Message: 1 of 3

Dear friends,

           I want to display a message or value 'zero' when my condition is false.

Simulink:
If condition block(I dont want to use else condition)

If (u1<0.00019) (
Before this if condition I am doing u1-u2=0 and if true

Action block (Embedded Matlab function):

function y = fcn(u)
%#eml
   
y = ((0.297/(u+u))-1)*(10000+1000000);


If not true:

When condition is not true I am getting 'inf' display as I am simulating under 'inf'
but how can I make the display '0' or any message instead of 'inf'?

any suggestion will be appriciated
Sandhi


   
       

Subject: Inf

From: Oleg Komarov

Date: 23 Feb, 2010 15:10:22

Message: 2 of 3

"Prashant Sandhi" <sanddhi7@gmail.com> wrote in message <hm0p37$hvp$1@fred.mathworks.com>...
> Dear friends,
>
> I want to display a message or value 'zero' when my condition is false.
>
> Simulink:
> If condition block(I dont want to use else condition)
>
> If (u1<0.00019) (
> Before this if condition I am doing u1-u2=0 and if true
>
> Action block (Embedded Matlab function):
>
> function y = fcn(u)
> %#eml
>
> y = ((0.297/(u+u))-1)*(10000+1000000);
>
>
> If not true:
>
> When condition is not true I am getting 'inf' display as I am simulating under 'inf'
> but how can I make the display '0' or any message instead of 'inf'?
>
> any suggestion will be appriciated
> Sandhi

Not clear.

Oleg

Subject: Inf

From: Prashant Sandhi

Date: 23 Feb, 2010 15:47:04

Message: 3 of 3

I got the solution Mr.Oleg. Still I Thank you for your reply.
have a good day.

"Oleg Komarov" <oleg.komarovRemove.this@hotmail.it> wrote in message <hm0r4u$16b$1@fred.mathworks.com>...
> "Prashant Sandhi" <sanddhi7@gmail.com> wrote in message <hm0p37$hvp$1@fred.mathworks.com>...
> > Dear friends,
> >
> > I want to display a message or value 'zero' when my condition is false.
> >
> > Simulink:
> > If condition block(I dont want to use else condition)
> >
> > If (u1<0.00019) (
> > Before this if condition I am doing u1-u2=0 and if true
> >
> > Action block (Embedded Matlab function):
> >
> > function y = fcn(u)
> > %#eml
> >
> > y = ((0.297/(u+u))-1)*(10000+1000000);
> >
> >
> > If not true:
> >
> > When condition is not true I am getting 'inf' display as I am simulating under 'inf'
> > but how can I make the display '0' or any message instead of 'inf'?
> >
> > any suggestion will be appriciated
> > Sandhi
>
> Not clear.
>
> Oleg

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
display Prashant Sandhi 23 Feb, 2010 09:39:05
rssFeed for this Thread

Contact us at files@mathworks.com