Welcome to Westonci.ca, the place where your questions find answers from a community of knowledgeable experts. Connect with professionals on our platform to receive accurate answers to your questions quickly and efficiently. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.

Matlab Question:
Important! Read: No for or while loops may be used; must use the disp function
The top speeds of sportscars, given in miles per hour, are:
155 mph BMW M5
217 mph Lamborghini Aventador Spyder
205 mph Ferrari 488
205 mph Nissan GTR
197 mph Chevrolet Corvette Stingray ZR1
258 mph Bugatti Veyron Supersport
195 mph Dodge Viper
270 mph Hennessey Venom
155 mph BMW M3
195 mph Mercedes SL
Write a function selectCars to identify cars with top speed within a given range and display the identified names. The selected cars speed will be in a range given by lowerBound < speed < upperBound. Inputs to the function selectCars are a column array topSpeeds that lists of top speeds, the corresponding column array carNames with car names, and lowerBound and upperBound both given in km/h.
Given:
To display the selected carNames, for example the first two, use something analogous to disp(carNames(1:2,:))
1 mile = 1.609 kilometers
Test data sets for topSpeeds and carNames (provided in example function call)
Restriction: For and while loops may not be used.
The function call is:
function identifiedCars=selectCars( topSpeeds, carNames, lowerBound, upperBound)
For example:
selectCars( topSpeeds, carNames, 287,338)
produces:
Ferrari 488
Nissan GTR
Chevrolet Corvette Stingray ZR1
Dodge Viper
Mercedes SL


Sagot :

Your Function Save CReset MATLAB Documentation 1 function identifiedCars-selectCars( topSpeeds, carNames, lowerBound, upperBound) 2 % select cars that have top speed within a given range and display the names to the command line.

How does a command line work?

A text-based command line is your computer's user interface. It's a program that accepts commands and then sends them to the computer's operating system for execution. Hence one can use the command line to browse through files and directories on your computer in the same way that you would on a computer running Windows Explorer or Mac OS Finder.

4% Inputs: column array topSpeeds with top speeds in mile/hour, corresponding column string array carNames with the car names lowerBound and upperBound in km/h 7% 8 9 % Your code goes here % 10 11 end Code to call your function Reset 1 topSpeeds [155; 217; 205 ;205 ;197 ;258 ;195;270;155; 195]; 2 carNames-charBMW M5', Lamborghini Aventador Spyder',... Ferrari 488',.. . Nissan GTR',... Chevrolet Corvette Stingray ZR1',.. . Bugatti Veyron Supersport'.. Dodge Viper',... 'Hennessey Venom', BMW M3',.. . 'Mercedes SL'; 4 5 7 9 10 12 lowerBound =200; upperBound-280; 13 [ identifiedCars ] = selectCars( topSpeeds, carNames, lowerBound, upperBound);

To learn more about command line, visit:

https://brainly.com/question/29105693

#SPJ4

View image SonaDas