[Scilab-users] qustion on functional argument

Stefan Du Rietz sdr at durietz.se
Mon Apr 20 12:19:31 CEST 2015


You don't need find().

k = x>1;

Stefan


On 2015-04-20 12:09, Frederic Jourdin wrote:
> I suggest something like this:
>
> function b=g(x)
> b    = 1/x
> k    = find( x>1)
> b( k)= x( k) + 1
> endfunction
>
> Fred
>
> Le 19/04/2015 17:57, fujimoto2005 a écrit :
>> function b=g(x)    if x>1 then
>>          b=x+1
>>      else
>>          b=1/x
>>      end
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users





More information about the users mailing list