![]() Disp function helps us to get the output displayed without getting the name of the variable.To display text or numeric values in MATLAB, we use disp function.For this example, we will be combining 3 variablesĭ = [ Country, ' is ranked ', num2str(Rank1), 'th in terms of nominal GDP and ',Īs we can see, the output has values that are derived from multiple variables. ![]() Let us take another example where we will use disp function to get output displayed out of multiple variables. 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.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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |