Pass the variables as parameters to the disp functionĭ = Īs we can see, the output has values that are derived from multiple variables.Create a new variable with the above two variables and with any text required in between the variables.Initialize the variables to be displayed.
Font box matlab text how to#
In this example, we will learn how to use the disp function when we have multiple variables. Next, we will learn how to display values stored in multiple variables. In the above 2 examples, we used the ‘disp’ function to either display numeric values or text. Please note that only the text of A is displayed, and not the variable ‘A’ itself. Pass the string as a parameter to the disp functionĪ = 'Let us learn how to display text in MATLAB'Īs we can see in the output, the input string is displayed using the disp function.Initialize the string which we want to display.In this example, we will learn how to display a simple text in MATLAB using disp function. Please note that only the values of A are displayed, and not the variable ‘A’ itself. Pass the array as a parameter to the disp functionĪs we can see in the output, the elements of array A are displayed using disp function.Initialize the array whose elements we want to display.In this example, we will learn how to display a simple array in MATLAB using disp function. Let us now understand the code of ‘disp function’ in MATLAB with the help of various examples: Examples of Matlab Display Textįollowing are the examples are given below: Example #1 nothing is displayed on the output screen