Suppose that you have a catalogue of automobiles such as in the following table (usually this table is very long): ID Color (0= black, 1=blue,
Suppose that you have a catalogue of automobiles such as in the following table (usually this table is very long):
ID | Color (0= black, 1=blue, 2= red) | Price ($) |
1002 | 0 | 24,000 |
2176 | 1 | 18,000 |
3201 | 2 | 36,000 |
4204 | 1 | 26,000 |
5512 | 2 | 35,000 |
6309 | 0 | 29,000 |
8841 | 1 | 31,000 |
9004 | 0 | 38,000 |
Write a Matlab function that reads in this Excel file and will allocate a vector for ID, a vector for color, a vector for price, and return the ID numbers of black cars that are priced under $30,000. You must use loops.
Your function should write for the user the IDs corresponding to the criteria set (the IDs should not be written one by one within the loop, but at once when the loop is finished).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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