To write:
A script that will calculate the circumference of a circle
Answer to Problem 3.1P
Solution:
The created variable
Explanation of Solution
The formula to calculate the circumference of a circle is,
Here, the radius of the circle is
Consider, the radius is
Substitute
MATLAB Code:
clc
clear all
close all
r = 2;
% Define the variable r.
C = (2*pi*r)
% Define the variable circumference.
Save the MATLAB script with name, chapter3_54793_3_1P.m in the current folder. Execute the script by typing the script name at the command window to create a variable C and store circumference in it, define the variable
Result:
Therefore, the created variable
Want to see more full solutions like this?
Chapter 3 Solutions
MATLAB: A Practical Introduction to Programming and Problem Solving
- College Algebra (MindTap Course List)AlgebraISBN:9781305652231Author:R. David Gustafson, Jeff HughesPublisher:Cengage LearningAlgebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:Cengage
- Holt Mcdougal Larson Pre-algebra: Student Edition...AlgebraISBN:9780547587776Author:HOLT MCDOUGALPublisher:HOLT MCDOUGALMathematics For Machine TechnologyAdvanced MathISBN:9781337798310Author:Peterson, John.Publisher:Cengage Learning,Algebra and Trigonometry (MindTap Course List)AlgebraISBN:9781305071742Author:James Stewart, Lothar Redlin, Saleem WatsonPublisher:Cengage Learning