MATLAB: Set object property of a user-defined class

oopset object property user-defined class

Hello,
I want to set the properties "nb_pixel_horiz" and "nb_pixel_verti" of an object "p" that has the user-defined class "Picture".
I wrote
classdef Picture
properties
nb_pixel_horiz;
nb_pixel_verti;
end
methods
end
end
And I want to write in the main command something like:
p = Picture;
set(p,'nb_pixel_horiz', 2000);
set(p,'nb_pixel_verti', 1000);
But it does not work. Could someone help me?
Thanks! Guillaume

Best Answer

Hey, Another Guillaume!
You need to derive from hgsetget, so:
classdef Picture < hgsetget
properties
nb_pixel_horiz;
nb_pixel_verti;
end
end