Question: using matlab please 2. [Submit on zyLabsl Write a function that creates a structure that represents a car. It should take the following inputs: mass,

using matlab please  using matlab please 2. [Submit on zyLabsl Write a function that
creates a structure that represents a car. It should take the following

2. [Submit on zyLabsl Write a function that creates a structure that represents a car. It should take the following inputs: mass, the mass of the car in kg passengers, the number of passengers the car should hold isElectric, a Boolean variable that indicates whether the car is electric (true) or not (false) fuelORcharge, a number that is either the volume of fuel the car has OR the percent charge the battery of the car has - - - - workPerUnit, the rate at which the car's engine converts fuel or battery life into forward energy Your program should then check to see if the car is valid. Invalid car properties include: Values less than 0 for any numeric property. A value greater than 100 for fuelORcharge if isElectric is true. Batteries cannot be more than 100% charged. If your car is invalid, your output car should simply be the string 'Invalid car parameters. If your car is valid car should be a structure. Each property of car should have the same name and value as each input variable. So, if your input mass was 300, car.mass would also be 300 Please follow the instructions given in the Assignment 6 document. Your inputs must be in the following order, and the properties of the car structure must have the following names EXACTLY as spelled and capitalized: mass passengers isElectric fuelORcharge workPerUnit Please make sure your string for an invalid car matches the string in the document EXACTLY Your Function Save C Reset MATLAB Documentation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!