[Top][All Lists]

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

Re: Handle to a non-static method

From: Mike Miller
Subject: Re: Handle to a non-static method
Date: Wed, 21 Jun 2017 18:48:19 -0700
User-agent: NeoMutt/20170306 (1.8.0)

On Wed, Jun 21, 2017 at 12:55:55 -0500, Andres Felipe Acosta Gil wrote:
> I am trying to obtain a handle to a non-static method of a class which has
> been implemented with classdef. How can I achieve this in Octave?, I have
> verified that it can be done in Matlab. I also tried the workarounds
> suggested in, with no success. I got,
> among others, the error "error: method `foo' is not static".

We would be able to help you better if you showed what you have tried.

The wiki suggests using an anonymous function, which works for me:

  fcn = @(obj, val) obj.some_method (val);


reply via email to

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