Function Name: fluxCapacitor
Inputs:
1. (double) The current year
2. (double) Destination year
3. (double) Speed, in miles per hour
Outputs:
1. (char) String stating whether you’re going back or forward into the future
Background: Doc Brown has invited you on an adventure through time. As you two hop into the time-travelling Delorean, he inputs the current year and the destination year. As the Doc steps on the gas, he reminds you that you can’t interact with ANYONE, or you’ll risk changing the flow of time itself! Midway through the speech, he realizes that the car might not reach the necessary speed to travel through time, so you'll need to quickly determine if you'll make it through time.
Function Description:
Write a function that takes in the current year, a destination year, and the max speed that the car can reach on the runway. Using these values, determine whether you’ll be going back in time, to the future, or straight into a building if the speed is less than 88 mph.
● If you're going forward in time, output: 'We're going to the year , to the future!!!'
● If you’re going back in time, output: 'We're going to the year , back in time!!!'
● If you're going under 88 mph, you won't be able to time travel, so output: 'Time traveling is just too dangerous. Better that I devote myself to study the other great mystery of the universe: MATLAB!'
Example:
out = fluxCapacitor(2008, 3000, 89);
>>out => 'We're going to the year 3000, to the future!!!'
Notes:
● The current year and destination year will never be the same.
● To create a character vector with an apostrophe, use two apostrophes in a row. Hints:
● Use the values from the first movie for a sweet surprise!
function out=fluxCapacitor(sdate,endate,speed)
diff=endate-sdate;
if(speed>88)
if(diff>0)
out=sprintf('We''re going to the %d,to the future!!!',endate);
else
out=sprintf('We''re going to the %d,back in time!!!',endate);
end
else
out='Time traveling is just too dangerous. Better that I devote myself to study the other great mystery of the universe: MATLAB!';
end
end
Expected output:
Function Name: fluxCapacitor Inputs: 1. (double) The current year 2. (double) Destination year 3. (double) Speed,...
Function Name: citizenWatch Inputs: Extra Credit 1. (double) T he current position of the hour hand 2. (double) T he current position of the minute hand 3. (double) A positive or negative number of minutes Outputs: 1. (double) The position of the hour hand after the specified time 2. (double) T he position of the minute hand after the specified time Background: The moment is finally here. You’ve been saving up your whole life and now you can finally afford...
MATLAB code help!
Function Name: chemTimer Inputs: 1. (double) The current position of the hour hand 2. (double) The current position of the minute hand 3. (double) A positive or negative number of minutes Outputs: 1. (double) The position of the hour hand after the specified time 2. (double) The position of the minute hand after the specified time Background: Oh no, you were running late to your Chem lab and completely forgot your reaction timer! It's a good thing...
Function Name: zoomZoom Inputs: 1. (double) An Nx5 array of scooters' speeds at various times 2. (double) The time at which you want to find the scooters' speeds Outputs: 1. (double) A 1x5 vector of scooters' speeds at the given time Background: Scooter go zoom zoom! Function Descripti on : You will be given an array with times in the first column, and speeds of different electric scooters in columns 2-5 that correspond to those times. Use spline interpolation or...
Function Name: runBabyRun Inputs: (double) Target distance to run before half-marathon (double) A 4x7 array of miles run each day in the month of February Outputs: (double) The most improvement made between consecutive days (logical) Whether you met your target distance for a single run (double) 1x4 vector of how many total miles you ran each week Function Description: With this New Year, you decide that you are actually going to run that half-marathon that has been on your calendar...
MATLAB code help!
Function Name: jackSparrow Inputs: 1. (double) A 1x2 vector describing your hand 2. (double) A 1x2 vector describing Jack Sparrow's hand 3. (double) A vector with the next cards to be drawn from the deck Outputs: 1. (char) A description of the game outcome Background: You're out at sea with the infamous Jack Sparrow, and it's a pretty calm day. Without anything better to do, Jack Sparrow challenges you to his favorite card game: BlackJack (Sparrow edition)...
Using MATLAB, please read
question well
Function Name: stPaddysFeast Example search- Inputs 1 (struct) A MxN structure array 2. double) A 1x2 vector of your starting position: [row, column] next: [1, 3] next: [1, 1] next: [2, 1) food: 'potato food potato next: 2, 3] step 2 food: start next: [2, 2] food: 'potato' step 3 Outputs next [1, 21 food: food: 1. (ohar)A descriplion of how mary potatoes you found ad where you stopped looking step 4 (stop) Background...
MATLAB Function Name: vineConpilation Inputs: 1. (chan The first vine quote 2. (chan The second ine quote Outputs: 1 (chan A "complilation" of the vines Background: It's Sunday aftemoon and you're hanging out in your lounge, finishing of your Sprite Cranberry. Your Mom Friend (Jared, 19) walks in and yells at you for drinking soda for breakfast. Aggravated, you YEET the empty can down the hall as Jared drags you to he kitchen to make breakfast. You open the fridge...
matlab
Example: Function Name: battleFormation formation([3 5 11, formation1.txt) Inputs: (double) 1xN vector of the number of soldiers each line 2. (char)A file name, indluding extension, for the output file group number Formation1.txt: 1 Line 1 has the following line up: e 1 1 1 0 File Outputs: 21 Line 2 has the folloOwing line up: 1 1 1 1 1 1. A text file showing the soldiers formations 3 Line 3 has the following line up: e e 1...
matlab
Example: Function Name: battleFormation formation([3 5 11, formation1.txt) Inputs: (double) 1xN vector of the number of soldiers each line 2. (char)A file name, indluding extension, for the output file group number Formation1.txt: 1 Line 1 has the following line up: e 1 1 1 0 File Outputs: 21 Line 2 has the folloOwing line up: 1 1 1 1 1 1. A text file showing the soldiers formations 3 Line 3 has the following line up: e e 1...
For the double diode circuit shown in figure 2-1, answer the following questions. In Figure 2-1 a) (10pts) For the triangular wave input shown (Vin), sketch the output voltage (Vout) using the constant voltage drop model (CVD: Vo-0.7V). Be sure to note the voltage values on the y-axis of your Vout plot and show any equations you used to determine those values ime FEE 334: Spring 2019 Midterm b) (2pts) During the middle of the first time segment (when Vin...