Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ENGR 1202 Spring 2019 MATLAB Homework #3 Instructions: Solve the following problems in a MATLAB script. You will be allowed to submit only one script,

ENGR 1202 Spring 2019 MATLAB Homework #3 Instructions: Solve the following problems in a MATLAB script. You will be allowed to submit only one script, please work all the problems in the same script (Hint: careful with variables names) Show your work and make comments in the same script (Use %). Please refer to formatting files previously announced/discussed. P1: As comments in your script, describe the following MATLAB calls briefly in your own words: a. clc b. clear all c. close all P2: For an image titled figure01.png, complete the following (each figure must have a title; figures with subplots must have a figure title with subplot titles as well): a. Display the image in its own figure. b. In a figure of subplots: first row, show the original image in the top-left corner/middle spot & give the grayscale image in the top-right; the following rows will consist of the 3 color channels in the mid row, followed by the last row excluding one of the 3 color channels (hint: display in order of the colors, ie, rgb are the individual channels of a typical color image) c. Find the black pixels of the image for each color channel and convert them to white. Display the original image and edited image side by side in one figure (ie, row subplots). P3: Create a function titled colorChannel, which uses switch statements, that will allow you to input red, green or blue (hint: you can classify these as numbers or strings, dont forget to comment), where the output is the respective channel color of the image titled figure01.png. Complete the following (each figure must have a title; figures with subplots must have a figure title with subplot titles as well): a. Call your colorChannel function to give you the red channel. Display the original image and red channel image side by side. b. Call your colorChannel function to give you the blue channel. Display the original image and blue channel image side by side. c. Call your colorChannel function to give you the green channel. Display the original image and green channel image side by side. P4: Plot the following information (Include a title, legend and labels for the figure, where only the labels/legend/title of the figure have Greek symbols included in them, ie, instead of alpha): a. Alpha () goes from 0 to 730 degrees. b. Vm = 10 volts; Im=5 Amps c. V=Vm cos () and I=Im sin() d. Plot (,V) and (,I) in the same plot using different line/marker styles and colors. P5: Using the information from zybooks (including chapter 10) and in class discussions you have learned, solve the following. Create a way for the code to tell someone what one should wear based on the weather. The variable you are checking for are the temperature, wind and rain are checked against each other at once (hint: logical operators); the temperature is in Fahrenheit from 0-100 degrees, wind speed from 0-60, and the rain is either there or not. Another variable is how the person feels that day (they can feel: good, okay, or bad) is checked. From this, the code will output what to wear. All of the values will be input as one array. See the example below to check how this array would look like. Please split up what a person would do from temperatures and wind speeds by 4 each (ie, 100/4 = range of 25). a. Remember to tell the user the parameters (you can use my example or make it better for explaining to the user what to input) b. Good code comments are great (ie, explain these magical numbers for rain or feeling variables next to statements that use them in your solution). Explain how you want to solve the problem briefly in your script comments (ie, if statements, switch statements, logical operators, etc.; it can be a short list or sentence, just give an idea to others of your chosen solution method). For Bonus Points: Come up with a fairly well known theme (ex: Lord of the Rings, Harry Potter), to tell the user what to wear in a fun and nerdy way! Dont forget to tell us the theme in the code comments (and hints to it for the user inputting the array of values). Example Command Window: Please input the temperature in Fahrenheit from 0-100, the wind velocity from 0-60, whether there is rain (rain = 1, sunny = 0), and how you are feeling (good = 2, okay = 1, or bad = 0) in one array: [30, 10, 1, 0] You should wear a big rain coat today and warm, fun socks! Hope you feel better soon :) Bonus Ex: Dont forget your winter cloak and an umbrella charm today! Maybe stop in for a nice butterbeer at Hogsmeade to warm up yourself and your day :) -OR- [75, 10, 0, 1] Its a nice day for spring type clothes, and maybe a light jacket if you want. It will be a wonderful day! Bonus Ex: Its a great day for riding through the plains of Rohan in light armor. OR: Its a lovely day for gardening here in the Shire with only a light jacket to add to the usual Hobbit attire!

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

Step: 3

blur-text-image

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

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions