MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > conditional operator 

Hi there fellow MATLABers, 
Dietrich Lueerssen wrote: 
David Bateman wrote: 

the missing ?: ternary function is a wellknown Matlab issue for a 
I am not aware of an official ifstatement that can be implemented in an anonymous function. However, you can (slightly artificially) create your own ifstatement by writing yourself a deltafunction by using given Matlab functions (such as heaviside, dirac, floor, ceil, etc.) 
The only way around such things as this (as far as using anonymous functions) that I know of is by using multiple function evaluations. 
"Dietrich Lueerssen" <Dietrich.Lueerssen@REMOVETHIS.ogt.co.uk> wrote in message <ef55682.1@webcrossing.raydaftYaTP>... 
"Dietrich Lueerssen" <Dietrich.Lueerssen@REMOVETHIS.ogt.co.uk> wrote in message <ef55682.1@webcrossing.raydaftYaTP>... 
I had the same Problem before, solved it a little bit differently. I made the if statement into a seperate function that would return a logical 1 or 0. Then I multiplied the result of my iffunction with the result of my function and added the two results. I.e. 
"Matt " <xys@whatever.com> wrote in message <gt53q1$qu6$1@fred.mathworks.com>... 

"Dietrich Lueerssen" <Dietrich.Lueerssen@REMOVETHIS.ogt.co.uk> wrote in message <ef55682.1@webcrossing.raydaftYaTP>... 
"Matt J" wrote in message <i5jek0$ntg$1@fred.mathworks.com>... 
On Nov 2, 8:20 pm, "Roger Stafford" 
"Roger Stafford" wrote in message <j8qqvq$i10$1@newscl01ah.mathworks.com>... 
"Steven Lord" <slord@mathworks.com> wrote in message 

"Steven_Lord" <slord@mathworks.com> wrote in message <kicgmk$okd$1@newscl01ah.mathworks.com>... 
"Steven_Lord" <slord@mathworks.com> wrote in message <kicgmk$okd$1@newscl01ah.mathworks.com>... 
"Steven_Lord" <slord@mathworks.com> wrote in message <kicgmk$okd$1@newscl01ah.mathworks.com>... 


"Steven_Lord" <slord@mathworks.com> wrote in message <kid62m$997$1@newscl01ah.mathworks.com>... 
"Steven_Lord" <slord@mathworks.com> wrote in message <kid62m$997$1@newscl01ah.mathworks.com>... 
"Steven_Lord" <slord@mathworks.com> wrote in message <kid62m$997$1@newscl01ah.mathworks.com>... 

"Steven_Lord" <slord@mathworks.com> wrote in message <kipoh0$eb1$1@newscl01ah.mathworks.com>... 
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.