Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help writing this script in matlab for both assign03a.m and assign03b.m The algorithm script for both assignments is in green on the first
I need help writing this script in matlab for both assign03a.m and assign03b.m
The algorithm script for both assignments is in green on the first page.
I am only allowed to use the commands in assign03a.m : input, mean, and linspace for creating the rate vector
In assign03b.m I am only allowed to use input, mean, and create rate vector using colon notation
A sample of what these scripts are supposed to output is located on page 2
Program: assign03a.m Write a MATLAB script file that uses principal (or amount), rate of interest, and time to compute and display the simple interest with appropriate labeling. Create a vector of rates using the following information entered from user. Ask the user to enter the low and high values for the rate range and the number of rates. Ask the user for the number of years. Problem CONSTANTS: (with units) PRINCIPAL 4000 8 dollars Problem Inputs: (with units) vector of rates of interest using information entered by user percent time entered by user 8 years Problem Outputs: (with units) simple interest 8 dollars average rate of interest and simple interest percent Other variables: (with units) minimum and maximum rates percent number of rates Equation: See above. Algorithm: See green comments below. Type the green comments as GIVEN in the editor window and use as a guide for typing the MATLAB statements. Run output: See below. Start your program file by typing the following into your empty editor window. Type yours/your group and other required information comments. Type the algorithm as given below as comments to guide you when writing the MATLAB instructions to do the tasks to solve the given problem. . Below the comment, type the MATLAB statement(s) that o what the comment says. This example should help. NO error checking Do not use commands and statements beyond what has been taught on class. Do not use commands and statements in assign01 until they have been discussed in class. | discussed in class. P or none New commands: input() mean() 1 Continue: submitter's name, GROUP # or none other group members' names or none Program tile name due date of the assignment statement(s) about collaboration. See syllabus for examples. a short narrative about what the file does Create rate vector using linspace() format bank, compact asp dispo Use descriptive variables. clc, clear all Format bank format compact *** CONSTANTS get principle get principles ***** INPUT ***** get interest rate per period range and time from the user $ create rate vector ***** COMPUTE ***** compute simple interest ($) create a table with rate and simple interest get the average rate and interest **** OUTPUT ***** diaplay simple interest with label display average rate and interest with Label 20(1).pdf 1.00 Sample output: 2 separate runs Run Enter the low value for the rate range: 4 Enter the high value for the rate range: 5 Enter the number of Eate values. This includes high and love Enter number of years: 4 Rate() Interest (1 640.00 Some rounding differences allowed 43 693.33 4.67 706.57 5.00 300.00 Blank line here Average: Rate ) Interest (3) 4.50 Run 2 Enter the low value for the rate range: 3.75 Enter the high value for the late Tange: 5 Enter the number of mate values. The ineludes hoh and low Enter Tuber of years Rate() Interest 1200.00 Some rounding differences 1266.67 3. 4.79 11.400.00 1466.67 1533.33 1500.00 age Rates Interest 1600.00 Program: assignb.m Modify as ja to rate the rate ve n n notation Aktheusce for the information needed to create the vector Problem CONSTANTS: (with units) PRINCIPAL 4000 NO error checking, Problem Inputs: (with units) vector of rates of interest using information entered by user Do not use commands and statements beyond patcent time entered by user what has been taught on class. Problem Outputs: (with units) Do not use commands and statements in simple interest assigol until they have been discussed in class. average rate of interest and simple interest Other variables: (with units) New commands: minimum and maximum rates input() mean increments of rates create rate vector using colon notation Equation: Continue: See above. format bank, compact Algorit : disp() The algorithm for assign3b.m is the same as for assign3am Use descriptive variables. Sample output: 2 separate runs percent Enter the low value for the rate range: Enter the maximum value for the cate range: 5 Enter the increment between Eatest .25 Enter number of years 4 Ratels interest (0) 4.00 640.00 Seme rounding differences Enter the low value for the rate ange: 3.75 Enter the aim value for the rate range: 5 Enter the there between rates Enter number of years Rate() Intext 900.00 9 .20 1058.40 4.25 60.00 720.00 180.00 800.00 5.00 Interest Average Rate() 1.50 Interest 720.00 NOTE: Your submitted files) MUST be spelled and cased as instructed Submit via Canvas: assigno3a. MATLAB script file assign03. MATLAB script file One submission per group. Canvas links members to files and rubric. A script cannot run from Canvws. It must be downloaded, saved, and "run". COMP1200m Spring 2020 - 3 of 3 DOLLStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started