IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
iif.m
Go to the documentation of this file.
1 %> @ingroup misc maths
2 %> @brief in-line "IF"
3 %> @file
4 %>
5 %> This function takes three parameters. The first parameter is a condition. If the condition is true,
6 %> returns the second argument, otherwise the third.
7 %>
8 %> @param condition
9 %> @param out1
10 %> @param out2
11 %> @return out
12 function out = iif(cond, x1, x2)
13 if cond
14  out = x1;
15 else
16  out = x2;
17 end;
function iif(in cond, in x1, in x2)