octave-maintainers
[Top][All Lists]
Advanced

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

Re: Classdef test request under Matlab


From: Michael Goffioul
Subject: Re: Classdef test request under Matlab
Date: Sun, 23 Feb 2014 09:43:44 -0500




On Sun, Feb 23, 2014 at 2:58 AM, Laurent Hoeltgen <address@hidden> wrote:
On 23/02/14 05:19, Michael Goffioul wrote:
> Could someone test the following for me in Matlab?
>
> Assume you have the following file clA.m in your path:
>
> classdef clA
>   methods
>     function y = meth1 (this)
>       y = 0;
>     end
>   end
> end
>
> Restart Matlab, I want to make sure clA.m hasn't been loaded into Matlab.
> Then create a handle to method meth1:
>
> h = @meth1
>
> Does Matlab accept that?
>
> Michael.
>
>

Hi,

I placed the file clA.m in ~/Documents/MATLAB, restarted Matlab and
obtained the following:

>> h = @meth1

h =

    @meth1

Running Matlab R2012a on Linux.

Can you then run the following:

h()
x = clA
h(x)

Finally, edit clA.m and introduce a syntax error, so the file cannot be parsed by Matlab. Restart Matlab and re-run the same commands: create h and run the 3 commands above.

Also does Matlab accept to create function handle to non existing functions? For instance @blahblah (assuming there's no such function on your system). If it does, this is different from octave. 

Thanks.
Michael.



reply via email to

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