Question
In Matlab, Let's say you are creating a script for an individual. Create a script that builds a structure named 'car' and include fields make,
In Matlab, Let's say you are creating a script for an individual. Create a script that builds a structure named 'car' and include fields make, model, year, mileage, class (car, van, truck, etc) and color. Have the script include 3 vehicles of your choosing then have the user input their own vehicles (use a loop and continue asking until the user is done entering
vehicles). When the user adds a specific make, model and year check the current array for duplicates.
If there is a duplicate, return a message to the user that says match found then display their data and the data of the duplicate. If there is no match, return the user entered values only. Ask the user if they would like to view all vehicles, and if they choose yes display all vehicles in a table with appropriate headings. Run your script. Use fprintf to format your table. The following code could be handy for formatting:
Use the same notation in your loop for each vehicle to create a formatted table.
f print ('\%12s 12412s V%12s N%12s N%12s N%12sIn', make model year mileage class color') ------An'); fprintf
Step 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