Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello! Can you help me with this Matlab problem 3. I have no idea on how to do the coding for that. Thanks a ton.

image text in transcribedimage text in transcribed

Hello! Can you help me with this Matlab problem 3. I have no idea on how to do the coding for that. Thanks a ton.

Test Cases > [C, K,lag- myTemp (100, 30 Problem 3: Function Inputs and Branching Write a function that determines the state ofa glass of milk. Use the function beader Function foutput11-glassLevalFunction personality, heightclass hieghtMilk, glas8volFunction) 37.7778 310.9278 where: lag .the input personality is a lxn char .the input heightGlass, hieghtMilk are a lxl doubles describing the height of the glass and the hight >> [c, K, flag] = myTetap ( [50:10:1001,25) of the milk respectively the input g l88V01 Pune t ion is a function handle describing the volume of the glass for a given height 10.0000 15.5556 21.1111 26.6667 32.2222 37.7778 e the output Outputl is a xn char array with the appropriate output given the inputs 283.1500 288.7056 294.2611 299.8167 305.3722 310.927B lag When only l input is given the following output should be assigned for the following personalities: Personali optimiat output That glasa 1s half full of milk That glass is half 11 need more informati n to make a conclusion about the state of the engineer IMPORTANT! Get in the habit of writing comments as you program. This is essential when writing more complex functions and scripts so that others can understand what you have created and how to use them. To start a line ofcomment, use the symbol % (it should turn green), and try to write as succinctly as possible. In the future, writing clear comments will help people (including yourself) debug code Any other personalit That qlass is half When all inputs are given the following responses for the following personalities should be displayed to the command window by calculating the volume of milk in the glass to 3 significant figunes. For example if the volume of milk was Soz and the olume of the glass was 12oz the following outputs should be assigned for the following personalitiers: Write a comment about your function. Describe the inputs, outputs, and what the function does in your Matlab code. Once you have written your comment, type help myTemp to see your comments. EXAMPLE function [c,r, flag-myTemp4F, maxTemp> %This function converts temprature in Fahrenheit to Celsius and Kelvin %The variable F is in Fahrenheit, C in Celsius, and K in Kelvin Personalit timiat ssimist 'That glass is 66.7% tull of milk, That glass is 33.38 empty That glass is 33.3 larger than it inputs: E- the temperature in Fahrenheit (double) maxTempthe maximum temperature double) engineer needs to be That glasa 1s 33.3s empt Outputs: C- the temperature in Clsius (double) Any other peraonalit K - the temperature in Kelvin glassLevelFunctionengineer) ans > help myTemp This function converts temperature in Fahrenheit to Celsius and Kelvin The variable F i8 in Fahrenheit, C in Celsius, and K in Kelvin I need more information to make a concluaion about the atate of the glass' Inputs:Fthe temperature in Fahrenheit (double) >> glassLevelFunctionOptimist' maxTemp - the maximum temperature (double) Outputs: C- the temperature in Celsius (double) K-the temperature in Kelvin (double) flag - a flag indicating if the max temp was exceeded {logical] That glass is half empty

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions

Question

Portal or media site.

Answered: 1 week ago

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago