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: Серёжа Плотников
Subject: Re: Does Matlab accept this syntax?
Date: Thu, 23 Jan 2014 09:50:04 +0100

I've also had warning (R2013a) when saving @clA/end.m: "MATLAB will not be able to run the file end.m uness you change its name". But it worked well -- @clA/end was called successfully.

Be happy,
Sergey


2014/1/23 Kai Torben Ohlhus <address@hidden>
On Thu, Jan 23, 2014 at 4:16 AM, 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


Hi,

I use MATLAB R2013b and get a warning when creating the @clA/end.m file. It is in conflict with the internal file:

/opt/MATLAB/R2013b/toolbox/matlab/lang/end

Best,
Kai


reply via email to

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