MATLAB: How to add a property to the handles

matlab gui

I'm creating GUI using guide. I added a new handles, but it does not contain any property (like struct). Please advice.

Best Answer

  • So your code is:
    handles.edit1 = 0;
    This way you don't create an object, you simply add a field to the structure "handles", with value 0. I think you misunderstand the concept of handles. A handle is merely a number to refer to an object. The handle itself does not contain any properties. In addition, you can't add properties to an object: all properties are defined by the type of object.