Page 1 of 1

Casting controllersets in Matlab

Posted: Fri Jul 26, 2019 2:56 am
by lsboers
Hi Guys,

I created a MEX wrapper that uses C++ to cast a PrescribedController from a controllerSet using dynamic_cast:

PrescribedController* controller = dynamic_cast<PrescribedController*>( &controllerSet.get(0) );

I was wondering if it is also possible to access the controllerSet's PrescribedController Properties solely in Matlab?

Regards,

Lars

Re: Casting controllersets in Matlab

Posted: Fri Jul 26, 2019 7:11 am
by tkuchida
You can try the safeDownCast() method (there's a Matlab example on the "Common Scripting Commands" page in the Confluence documentation; search this page for "safeDownCast": https://simtk-confluence.stanford.edu:8 ... g+Commands).

Re: Casting controllersets in Matlab

Posted: Tue Jul 30, 2019 7:08 am
by lsboers
Hi Thomas,

Thanks for the reply, works perfectly!

Regards,

Lars