Use MATLAB to solve the following exercise The volume of a s
Use MATLAB to solve the following exercise.
The volume of a sphere is given is V=4/3pir^3, where r is the radius of the sphere. Make a plot of volume vs. radius for radii of 1 to 10.
Solution
pi = 3.14; // constant value to define the pi value
x = linspace(1,10); // will vary from 1 to 10
y = 4/3 * pi * x * x * x; // volume of the sphere
plot(x,y); // plotting the value of x wrt y
