octave-maintainers
[Top][All Lists]
Advanced

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

Re: Functions in scripts


From: Nicholas Jankowski
Subject: Re: Functions in scripts
Date: Tue, 24 Jan 2017 14:17:34 -0500


What does this return in Matlab?

%%%%%%%%%%%%
x = 1;

localfunctions ()

z = f(x)

localfunctions ()

function y = f(x)
y = 2 * x;
end
%%%%%%%%%%%%

I'm interested in when Matlab adds the function to the symbol table, and Mike's question is whether it stays in the symbol table after the script finishes.

--Rik

>> testscript
ans =
  cell
    @f
z =
     2
ans =
  cell
    @f



reply via email to

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