Question

MATLAB Questions. I have a basic understanding of the tools for MATLAB, but do not know how to create the code for these questions. Please show the entire code.

2. A paper cup shaped as a frustum of cone with R-14R1 is designed to have a volume of 25 cm Determine R1, R2 and the surface area, S, of the paper for cups with a height, h, of 1O cm. The volume of the cup, V, and the surface area of the paper are given by: The program should ask the user to input the value for the height and display the result in the following format (two fprintf statements are needed, with a line break): The frustum of the cone with volume XXXX cubic centimeters Has radii values of R1 and R2 equal to XXX.XX and XXX.XX, respectively. Also, the surface area is XXX squared centimeters.Newtons law of cooling, provided below, given the temperature T(t) of an object at time t in terms of To, its temperature at t-0, and Ts, the temperature of the surroundings. 3. A police officer arrives at a crime scene in a hotel room at 9:18 PM, where he finds a dead body. He immediately measures the bodys temperature and records it as 79.5 °F. Exactly one hour later he measures the temperature again and finds it to be 78 °F. Write a MATLAB file that will determine the time of death, assuming the victims body temperature was normal (98.6F) prior to death, and that the room temperature remained a constant 67 °F. The program should prompt the user to input the surrounding temperature, the first temperature reading, the second temperature reading and the length of time passed (in minutes) between the readings. Your file should then output the following in the command window: The first temperature taken was XXXX, and after XXXX minutes the temperature was XXXX. The victim died XXXXXX minutes prior to being discovered.4. Stirlings approximation for large factorials is given by Use the formula for calculating 20!. Compare the result with the true value obtained with MATLABs built-in function factorial by calculating the error TrueVal - ApproxVal Error = TrueVal Your program should prompt the user for the number to calculate the factorial of and output the results using an fprintf to display in the Command Window. The value of XXX! Is estimated to be XXX while the actual value is XXXX. This produces an error

0 0
Add a comment Improve this question Transcribed image text
Answer #1

As per the HomeworkLib policy on multiple questions, answer to question (2) is being given here:

From the given relation:
V =-Ri( 1 + 1.42 + 1.4) ЗУ It 1-Th436

The corresponding MATLAB script is as the following:

%==============================================

clc;
clear all;

h = input('Please provide the height : ');

% Given data:
V = 25;

R1 = sqrt((3*V)/(pi*h*4.36));
R2 = 1.4*R1;

S = (pi*(R1+R2)*sqrt((R1-R2)^2 + h^2)) + pi*R1^2;

fprintf('The frustum of the cone with volume %d cubic centimeters ',V);
fprintf('Has radii values of R1 and R2 equal to %.3f and %.3f respectively. Also, the surface area is %.3f squared centimeters ',R1,R2,S);

%==============================================

Sample run:

Please provide the height : 10
The frustum of the cone with volume 25 cubic centimeters
Has radii values of R1 and R2 equal to 0.740 and 1.036 respectively. Also, the surface area is 57.537 squared centimeters

Add a comment
Know the answer?
Add Answer to:
MATLAB Questions. I have a basic understanding of the tools for MATLAB, but do not know...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MATLAB only please I am trying to get my getdatafuntion to work. I am also trying to get all my x...

    MATLAB only please I am trying to get my getdatafuntion to work. I am also trying to get all my x's, y's, and v's to popup in the command window so I can put in any value and it will find the value for me using the equation I put in. function project_9_sjl() % PROJECT_9_SJL project_9_sjl() is the driver function for the program. % %    Name: Scott Lawrence %   Date: 3/27/2019 %   Class: CMPSC 200 %   Description: Determine the optimal...

  • I need help solving these questions,please don’t know how to solve it by using matlab.!

    i need help solving these questions,please don’t know how to solve it by using matlab.! Solve the following questions Ol: You are required to develop a script to calculate the volume of a pyramid, which is 1/3 *base *height, where the base is length *width. Prompt the user to enter values for the length, width, and height, and then calculate the volume of the pyramid. When the user enters each value, he or she will then also be prompted to...

  • Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture...

    Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture i sent is the first page 5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 tt r) as output argument. Paste the function code below. Paste code here 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. 7. Design an...

  • MATLAB help! I have some MATLAB Assignment to do, the proffesor requires all the small parts...

    MATLAB help! I have some MATLAB Assignment to do, the proffesor requires all the small parts in order to get full credit. Help me out, thank you f LAB SECTION NAME HW6P3 (30 points) following are infinite series representations of the function, un pra i a script file HW6P3 that determines the value of the function from the sum of the series for a given value of x. The program (1 pt) must prompt the user to enter a value...

  • This is a matlab HW that I need the code for, if someone could help me figure this out it would b...

    This is a matlab HW that I need the code for, if someone could help me figure this out it would be appreciated. The value of t can be estimated from the following equation: in your script file, estimate the value of π for any number of terms. You must ask the user for the desired number of terms and calculate the absolute error/difference between your calculation and the built-in MATLAB value ofpi. Display your results with the following message...

  • I have included what I need to do for part b, and what I have so...

    I have included what I need to do for part b, and what I have so far. I 2.2 Part B Write a default version of program to report the behavior of the Linux kernel by inspecting kernel state. The program should print the following values to the user screen or console: CPU type and model Kernel version Amount of time since the system was last booted, in thefomdmm:5s (for example, 3 days 13 hours 46 minutes 32 seconds would...

  • Introduction to Engineering I Spring 2019 MATLAB Homework Assignment 1 a) Create a matrix called ...

    help wanted? Introduction to Engineering I Spring 2019 MATLAB Homework Assignment 1 a) Create a matrix called d from the third column of matrix a. (Hint, typing d 22: 5: 821 b) Combine matrix b and matrix d to create matrix e, a two-dimensional matrix with three rows c) Combine matrix b and matrix d to create matrix f, a one-dimensional matrix with six rows and d) Create matrix g from matrix a and the first three element of matrix...

  • i need help filling out this table please Balloon # Moles of gas that could in...

    i need help filling out this table please Balloon # Moles of gas that could in theory be produced Liters of gas that could in theory be produced % yield of gas produced -- show calc Show calculations for theoretical moles of gas and theoretical Liters of gas: [4.5pts] If the moles of a gas are known, along with the temperature and pressure, the volume of the gas can be calculated. This is how the theoretical volume of gas produced...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT