user1566200
user1566200

Reputation: 1838

Converting an object into array/matrix?

I have an object in Matlab created from a third party toolbox. Within the object is a 3x65 double array. If I type the name of the object in the Matlab console, it lists all the contents, and specifically says this 3x65 array is a double. All I want to do is to extract this array into a separate Matlab array. But when I do something like:

x = object.ArrayIWant

I get the error "Access to an object's fields is only permitted within its methods." If I try the following:

x = get(object,'ArrayIWant)

I get the error "Conversion to double from 'toolboxfunction' is not possible. How do get access to this array?!

Upvotes: 1

Views: 854

Answers (1)

chappjc
chappjc

Reputation: 30579

Look for "Get" methods in the class:

methods(object)

or

methods className

Say it says there is a method called GetArrayIWant, then you'd do:

x = object.GetArrayIWant();

Upvotes: 1

Related Questions