From the course: MATLAB 2018 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Display values within a script

Display values within a script - MATLAB Tutorial

From the course: MATLAB 2018 Essential Training

Start my 1-month free trial

Display values within a script

- [Instructor] When you perform a calculation, MATLAB assigns the result to a variable, and displays the result. You can control that display by changing the format of the output, adding one or more lines to the output, and by suppressing the output entirely. I will show you how to do all of those tasks in this movie. I have started MATLAB, and I have a blank command window. First, I'm going to start by defining a variable that I'll use in various calculations. I will type in radius, R-A-D-I-U-S equal 33. So the radius of the circles I'll deal with are 33. And Enter. And you see that MATLAB displayed the name of the variable and also its value. If I wanted to suppress output, I could add a semicolon to the end of the line. So let's say that I want to find the circumference of the circle. That would be circ, C-I-R-C is the variable name to which I will assign the result of my calculation. So two and asterisk for multiplication Pi multiplied by the radius, so two Pi R. I don't want the…

Contents