help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem failure file


From: Markus Mützel
Subject: Re: problem failure file
Date: Sat, 23 Feb 2019 10:19:58 +0100

Yet again: Please keep the mailing list in CC.

I think I answered the same questions in the response to your previous message. 
Please read below.
If you still have more specific questions, please do ask them.
 
 
Am 23. Februar 2019 um 09:17 Uhr schrieb "Robert Setif":
> Hello! and thank you.
> I write in English and you also answer to me in Englih: 
> I understand English but unfortunately speak it.
> Here is the file "dfac.m" joined  and what Octave answer:
> 
> " >> dfac1
> warning: function name 'dfac' does not agree with function 
> filename 'C:\Users\Robert\NEWPROG\Octave\dfac.m'
>  
> error: 'n' undefined near line 5 column 6
> error: called from
>     dfac1 at line 5 column 2  "
> but dfac(10)-> 3840  dfac(11)-> 10395 Ok
> I can't program dfac([1:10]).
> Unfortunately I am not able to vectorize that function.
> Would you correct my file, please? 
> That is not urgent. I am patient.
> Thank you very much and best regards.
> Robert SETIF  France
> address@hidden:address@hidden
>   
> 
> Le ven. 22 févr. 2019 à 18:33, "Markus Mützel" 
> <address@hidden:address@hidden> a écrit :
> Please keep the mailing > list in CC, so others who might be able to help can 
> answer as well.
>
> Am 22. Februar 2019 um 08:47 Uhr schrieb "Robert Setif":
> > Hello !
> > Thank you for your very fast answer. You find an error: "=" au lieu de 
> > "==". 
> > Je continue en français. Maintenant c'est ok, presque. Voici le message de 
> > Octave:
> > "error: 'n' undefined near line 4 column 6
> > error: called from
> >     dfac at line 4 column 2.
> > mais dfac(10) -> 3840
> >  Voici 2 questions:
> >  1. Cette erreur n'empêche pas de fonctionner. Mais elle est signalée dans 
> > presque tous mes programmes. Pourquoi "'n' undefined"  et  comment y 
> > remédier ?
> Your function "dfac" has one input argument "n". You probably see this error 
> because you called the the function without input argument. I haven't tried 
> but something like "dfac(5)" should not throw this error.
> 
> >  2. Comment faire pour que dfac([1:10]) fonctionne ? Il ya sans doute une 
> > autre façon de le faire, mais laquelle ?
> Each line of your function must work with "n" as a vector for this to work.
> E.g. instead of writing:
> if (n==0)
>   r=1;
> endif
> 
> you would write:
> r = zeros (size (n)); % initialize r to the same size as n
> r(n==0) = 1; % only set those elements in "r" that correspond to n==0
> 
> And appropriately for the other conditional branches.
> 
> > Thank you very much and best regards. 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]