Properties of Uilabel component

To control the appearances and behaviors of the component, Matlab provides many properties. Some important properties are as follows:

  • Text: The text property is used to control the content of the label. The default value is ‘Label’.
  • Interpreter: This property allows us to interpret the text of the label using a different interpreter. Like we can use latex code for writing equations or HTML for formatting as text and set the interpreter to be ‘latex’ or ‘HTML’. Default is ‘none.
  • HorizontalAlignment: Controls the horizontal alignment of the text within the label component. Default is ‘left’.
  • VerticalAlignment: Controls the vertical alignment within the component. Default is ‘center’.
  • Wordwrap: Wraps the text to fit the component’s width. Default is ‘off’.
  • FontName: changes the font for the text.
  • FontSize: controls the font size.
  • font-weight: controls the weight/boldness of the text.
  • FontAngle: controls the font angle.
  • font color: the color of the font.
  • BackgroundColor: change the background colour of the label.
  • Visible: This property controls the visibility of the component. Default is ‘on’.
  • Enable: Enable or Disabled appearance. Default is ‘on’.
  • TootTip: A text to guide the purpose of the component. Default is ”.

Label component in MATLAB GUI

Matlab is a numeric computing environment that comes with its own programming language. It specializes in technical computing in areas like Science, Engineering, and many others. Matlab also provides the ability to create GUI applications by simply using its functions for various GUI components.

In this article, we will learn about the Label component, how to create one, and its important properties.

Similar Reads

Label Component

A label is a UI component that holds the static text to label different parts of an application. It is useful in GUI applications as it describes the different parts of the UI. Matlab provides a function called uilabel to create a label. There are three syntaxes that can be used:...

Properties of Uilabel component

To control the appearances and behaviors of the component, Matlab provides many properties. Some important properties are as follows:...

Uilabel()

The first syntax does not need any parameters. It is created with “Label” as the default text. Matlab creates a figure window and stores the label into the window for us....

uilabel(parent)

...

uilabel(parent, Name, Value)

Matlab also provides the option to pass a custom window as the parent of the component....