Discussion:
Newbie keeps getting "invalid call to script" error
Faraz Hussain
2018-10-12 19:26:38 UTC
Permalink
I created a simple file called BasicClass.m but when I run from the command prompt, I get:
octave:3> a=BasicClasserror: invalid call to script /home/hussaif1/octave/BasicClass.m
The BasicClass.m file  is in the same folder as where I launch octave. It contains this code:
classdef BasicClass   properties      Value   end   methods      function r = roundOff(obj)         r = round([obj.Value],2);      end      function r = multiplyBy(obj,n)         r = [obj.Value] * n;      end   endend
shall689
2018-10-12 21:29:27 UTC
Permalink
It works for me in version 4.2.1.
c = BasicClass
c =





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Info
2018-10-16 14:01:19 UTC
Permalink
I created a simple file called BasicClass.m but when I run from the command prompt, I get:

octave:3> a=BasicClass
error: invalid call to script /home/hussaif1/octave/BasicClass.m

The BasicClass.m file  is in the same folder as where I launch octave. It contains this code:

classdef BasicClass
   properties
      Value
   end
   methods
      function r = roundOff(obj)
         r = round([obj.Value],2);
      end
      function r = multiplyBy(obj,n)
         r = [obj.Value] * n;
      end
   end
end

Loading...