Faraz Hussain
2018-10-12 19:26:38 UTC
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
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