Q:

Write a simple script that will calculate the volume of a hollow sphere,

0

Write a simple script that will calculate the volume of a hollow sphere,

where ri is the inner radius and ro is the outer radius. Assign a value to a variable for the inner radius, and also assign a value to another variable for the outer radius. Then, using these variables, assign the volume to a third variable. Include comments in the script. Use help to view the comment in your script. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Ch3Ex2.m

% This script calculates the volume of a hollow sphere

% Assign values for the inner and outer radii

ri = 5.1

ro = 6.8

% Calculate the volume

vol = (4*pi)/3*(ro^3-ri^3)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now