Risolto


Concatenating strings
* Write a statement that assigns fullName with firstName, a space, then lastName. Ex: If firstName is Alan and lastName is Tu...

quasi 8 anni fa

Risolto


Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros. Exam...

quasi 8 anni fa

Risolto


Vectors counting by 2
Create a vector numbers from 7 to 15 in increments of 2

quasi 8 anni fa

Risolto


Flipping
Write code that can reverse the vector without using any sort of loop. Example Given the input vector A = [ 1 2 3 4 5...

quasi 8 anni fa

Risolto


Complex number
For complex number c=a+bi, write code that will add a and b together.

quasi 8 anni fa

Risolto


Fahrenheit to Celsius converter
Convert Fahrenheit to Celsius degrees.

quasi 8 anni fa

Risolto


Squaring Matrix
Square the following matrix using matlab % A = 1 2 3 4 5 6 7 8 So new matrix should display...

quasi 8 anni fa

Risolto


Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

quasi 8 anni fa

Risolto


Celsius to Fahrenheit converter
Convert Celsius to Fahrenheit degrees.

quasi 8 anni fa

Risolto


While loop with multiple conditions
Write a while loop that multiplies userValue by 2 while userValue is not 10 and while userValue is less than 25.

quasi 8 anni fa

Risolto


Remainder
Make 'y' equal to the remainder of 27 divided by 5. When x=27 and t=5

quasi 8 anni fa

Risolto


While loop with branching
Write a while loop that adjusts userValue while userValue is less than 0 or greater than 80. If userValue is greater than 80, th...

quasi 8 anni fa

Risolto


Celsius to Kelvin
Convert Celsius degrees to Kelvin temperature.

quasi 8 anni fa

Risolto


Rounding
Round 10.67 and make 'y' equal to that number.

quasi 8 anni fa

Risolto


length of a vector
Find twice the length of a given vector.

quasi 8 anni fa

Risolto


Function definition: BMI calculator
Define a function CalculateBMI with inputs massKg and heightCm. The function returns bodyMassIndex. The function should be able ...

quasi 8 anni fa

Risolto


Logical operators: Flipping bits
The xor operator will toggle the bit if the bit is xored with 1. Ex: 1 XOR 0 = 1, 1 XOR 1 = 0. The xor operator will retain th...

quasi 8 anni fa

Risolto


Logical operators and arrays: 3-input and truth table
Given 3 inputs (inputA, inputB, inputC), assign threeInputAnd with the truth table outcomes for a 3 variable logical-and operati...

quasi 8 anni fa

Risolto


Constructing strings
* Construct a string alphaString from 'a' to endLetter, using the double colon operator. Ex: If endLetter = 'e', then alphaSt...

quasi 8 anni fa

Risolto


Logical variables: Running late?
* Assign onTime with true if noTraffic is true and gasEmpty is false.

quasi 8 anni fa

Risolto


Indexing the array: Shift right with variable sized arrays
* Write a statement to shift the array contents 1 position to the left. * Assign the rightmost element with -1. Ex: [12, 85...

quasi 8 anni fa

Risolto


Nth root.
* Assign outValues with the nth root of the inValues, the root is specified by rootValue

quasi 8 anni fa

Risolto


Relational operators and row arrays: Run times
* Construct a row array fastRunTimes containing all elements of runTimes equal to or less than 480 seconds. Ex: If runTimes =...

quasi 8 anni fa

Risolto


Multiple element-wise operations: Percent change
Row arrays sales2013 and sales2014 reflect the quarterly sales (in millions) of a popular potato chip company. Write a statement...

quasi 8 anni fa

Risolto


Extracting data: Heart rate (pulse)
The resting heart rate for an average adult is 60 - 100 beats per minute. Assign row array heartExtracted with all values in row...

quasi 8 anni fa

Risolto


Constructing column arrays
* Construct a column array elevatorStops with values 2, 4, 5, 9, and 10

quasi 8 anni fa

Risolto


Adding an element: Ticker tape
* Add stockPrice to the beginning of row array tickerTape

quasi 8 anni fa

Risolto


Function call in expression: Reduced pricing.
Write a single statement that assigns cartTotal with the discounted cost of items 1 and 2. Function DiscountedPrice will return ...

quasi 8 anni fa

Risolto


Column arrays: Transpose a row array
* Construct a row array countValues with elements 1 to endValue, using the colon operator. * Transpose countValues to result in...

quasi 8 anni fa

Risolto


Variable sized row arrays
* Reverse the contents of row array mileMarkers

quasi 8 anni fa

Carica altro