|
From: | Doug Stewart |
Subject: | Re: Placing Functions Inline to Script |
Date: | Thu, 8 Jun 2017 11:26:02 -0400 |
I am a new octave user (matlab refugee) and trying to get through a few very basic problems to get going. I am trying to define functions within a script as shown in the code below. The script fails claiming it cannot find the function. The only workaround is to make the main script a function as well but this has some repercussions regarding preserving variables. Short of having separate files running around with my functions is there a way to help the script "see" the function definition?
Thanks
Fritz
%%%%%%%%%% script %%%%%%%%
maxpoint(3);
%%%%%%%% functions %%%%%%%
function maxpoint (p)
printf("point= %d",p);
endfunction
error: 'maxpoint' undefined near line 2 column 1
_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |