MATLAB: Homework matlab problem – Determine r1, r2 and surface area – use matrix

MATLABsolve equations using matrix

ive been staring at this problem and cant get anything. im a college student i dont u see what to do with the unknown variables
the unit we are in now is covering – input and output commands – display commands – fprintf – load commands
help will be greatly appreciated KEEP IT SIMPLE IF POSSIBLE. THIS IS ONLY CHAPTER 4 OF AN INTRO CLASS
an ice cream cone shaped as a frustum of a cone with R2=(1.2)(R1) is designed to have a volume of 1,000 cm cubed. Determine R1, R2 and the surface area , s, of the paper for containers with heights h of 8, 10, 12, 14, and 16 cm. Display the results in a table. The volume of the container, V, and the surface area of the paper are given by
V = (1/3)(pi)(h)(R1^2 + R2^2 + R1R2)
S = (pi)(R1+R2)sqrt[(R2-R1)^2 + h^2] + (pi)(R1^2 + R2^2)

Best Answer

Hi Morley.
Below Is a code that solves your problem. Go through each step and understand. I hope it will help. For further details mail back
R1 = sym('R1','positive'); % Define R1 as a symbolic variable . It is positive
R2 = 1.2* R1; % Mention the relation between R1 and R2
table = zeros(5,4); % The table stores the h in the first column . The second column stores R1, the third one stores R2 and the fourth one stores s
table(:,1)=8:2:16; % Store the heights
for i = 1:5
x= solve((1/3)*pi*table(i,1)*(R1.^2 + R2.^2 + R1*R2)- 1000,'R1'); %Solve for the values of R1
table(i,2) = x;
table(i,3) = 1.2*x;
table(i,4) = pi * (1.3*x) *sqrt((0.2*x)^2 + table(i,1)^2) + pi*(x^2 + (1.2*x)^2); % Calcualte the surface area
end
Hope This helps
HAPPY TO HELP
UJJWAL