octave-maintainers
[Top][All Lists]
Advanced

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

Re: Does Matlab accept this syntax?


From: Michael Goffioul
Subject: Re: Does Matlab accept this syntax?
Date: Thu, 23 Jan 2014 07:14:28 -0500

On Wed, Jan 22, 2014 at 10:16 PM, Michael D. Godfrey <address@hidden> wrote:
On 01/22/2014 08:58 PM, Michael Goffioul wrote:
@clA/clA.m:
classdef clA
  methods
    idx = end (this, k, n);
  end
end

@clA/end.m:
function y = end (this, k, n)
  y = 1;
end
Matlab R2009b does not:

>> @clA/clA.m:
??? @clA/clA.m:
               |
Error: _expression_ or statement is incomplete or incorrect.

>> classdef clA
??? classdef clA
    |
Error: Illegal use of reserved keyword "classdef".

>>   methods
??? Error using ==> methods
Not enough input arguments.


>>     idx = end (this, k, n);
???     idx = end (this, k, n);
                  |
Error: Unbalanced or unexpected parenthesis or bracket.

>>   end
???   end
      |
Error: Illegal use of reserved keyword "end".

>> end
??? end
    |
Error: Illegal use of reserved keyword "end".

>>
>> @clA/end.m:
??? @clA/end.m:
         |
Error: Illegal use of reserved keyword "end".


>> function y = end (this, k, n)
??? function y = end (this, k, n)
    |
Error: Function definitions are not permitted at the prompt or in scripts.

>>   y = 1;
>> end


I meant to have 2 separate files: @clA/clA.m and @clA/end.m. Not a single file with everything in there.

Michael.


reply via email to

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