Calling static method from m-file (octave/matlab)

988 views Asked by At

I am currently having problems calling a static method located in an m-file, through the octave command interface. The error I'm getting is error: invalid call to script path/to/Test.m

Test.m:

classdef Test    
    methods(Static=true)
        function ret = test_function()
            ret = 0;
        end
    end
end

I am trying to call the method in the following way: > Test.test_function(). It's important to note that the script resides in the same directory in which I invoked the octave command, the script Test.m shows up using tab completion so the location is not at fault here I guess.

Any help is much appreciated, thanks in advance!

1

There are 1 answers

2
TroyHaskin On BEST ANSWER

From the Octave FAQ: "Matlab classdef object oriented programming is not yet supported, though work is underway in a branch of the development tree." So the error is likely arising from the lack of classdef support, and the parser can't make sense of the call at all.