problem failure file Classic List Threaded 5 messages Open this post in threaded view
|

problem failure file

 Good morning.Here is that file with a problem I do not understand.# dfac.m 21/2/2019  double factorialfunction r=dfac(n) f=1; if (n=0)   r=1; elseif (mod(n,2)=0)    for i=n:-2:2,f=f*i;,endfor else for i=1:2:n,f=f*i;,endfor  endif r=f;endfunctionThank you very much.Best regardsFRANCE
Open this post in threaded view
|

Re: problem failure file

 Am 21.02.19 um 10:16 schrieb Robert Setif:    Good morning. Here is that file with a problem I do not understand. # dfac.m 21/2/2019  double factorial function r=dfac(n) f=1; if (n=0)   r=1; elseif (mod(n,2)=0)     for i=n:-2:2,f=f*i;,endfor else for i=1:2:n,f=f*i;,endfor   endif  r=f; endfunction Thank you very much. Best regards FRANCE Maybe, if there would be a hint, what you do not understand, somebody might be able to help you.
Open this post in threaded view
|

Re: problem failure file

 In reply to this post by Robert Setif >Here is that file with a problem I do not understand. > ># dfac.m 21/2/2019  double factorial >function r=dfac(n) >f=1; >if (n=0) >  r=1; >elseif (mod(n,2)=0) >    for i=n:-2:2,f=f*i;,endfor >else >for i=1:2:n,f=f*i;,endfor >  endif > r=f; >endfunction You should tell us what is the problem and what you do not understand. If you run it and get an unexpected result or an error, you should copy and paste what you see on the command window (text, no image) and tell us what you expected instead. -- Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058 ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107 via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti (entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it