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.

Accept input values in a script

Accept input values in a script - MATLAB Tutorial

From the course: MATLAB 2018 Essential Training

Start my 1-month free trial

Accept input values in a script

- [Instructor] In the previous movie I showed you how to create a script to record a MATLAB procedure. The main limitation of that script, and it's an important one, was that every value was written directly into the code. There was no way to accept input. In this movie I will show you how to accept one or more input values for your MATLAB calculations. I have run MATLAB and I'm looking at a new blank command window. I want to create a script so I will go to the home tab and click the new script button. I could also press control n. And doing so displays a new editor window. I've been working for a while so mine is called Untitled4. Yours might have a different number. I want my script to be able to accept input from a user. So, I'll start by assigning a value to a variable. I'll call that radius. And my goal is to develop an equation that calculates the volume of a sphere. Rather than specifying the value directly, I want to accept input, and as you might imagine that uses the input…

Contents