help-octave
[Top][All Lists]
Advanced

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

Re: Trouble Using Functions


From: José Abílio Matos
Subject: Re: Trouble Using Functions
Date: Wed, 24 Jun 2020 21:18:06 +0100

On Wednesday, 24 June 2020 21.03.15 WEST Samuel Doughty wrote:
> Thank you Doug and Andrew.
> 
> When I move the function definitions to the beginning (right after the
> header line that reads %TestFile1.m), I still get errors, specifically --
> 
> warning: function name 's1' does not agree with function filename
> 'C:\Users\Sam\Desktop\Octave\Tests\TestFile1.m' error: print: no figure to
> print
> 
> Evidently there is something more that I'm missing.
> Sam

See the second answer here:
https://stackoverflow.com/questions/54013267/run-octave-script-file-containing-a-function-definition

that is due to the basic distinction between functions and scripts.

The line

1;

ensures that it is not a function and thus it is a script.

-- 
José Matos





reply via email to

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