Solved


design a magic matrix without using the command magic.
Like magic(4) = 16 3 2 13;5 10 11 8;9 6 7 12;4 15 14 1

11 years ago

Solved


Form a gaussian kernel using matrix size and sigma value
For example matrix = 3; sigma = 1.2; Gaussian kernel = [1 2 1; 2 2 2; 1 2 1]; ...

11 years ago

Solved


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...

11 years ago

Solved


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...

11 years ago

Solved


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

11 years ago

Solved


Logic array: Identifying qualifying times
Create a logic array qualifyingIndex with true for any location where the runner is male with a running time less than 8.2. Row ...

11 years ago

Solved


Find Sign(Zero Crossing) Changes in Array
Example; A = [1 2 3 -3 -4 -1 -24 2 4 -1 -2 3 1]; ans; [1 2 0 -3 -4 -1 0 2 0 -1 ...

11 years ago

Solved


Interior angles
Find the sum of interior angles for polygon of x sides.

11 years ago

Solved


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...

11 years ago

Solved


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...

11 years ago

Solved


Element-wise division
* Assign row array weightKilo with the corresponding weight in kilograms. Use the following conversion: kg = lb / 2.2

11 years ago

Solved


Integer indexing array: Shift left
Write a *single* statement that shifts row array attendanceValues one position to the left. The rightmost element in shiftedValu...

11 years ago

Solved


Smallest and Largest Real Numbers
Complete the function by assigning minReal with the smallest positive double precision floating-point number, and maxReal with t...

11 years ago

Solved


Box!
Given a box, find the volume of the cube. With each side = a.

11 years ago

Solved


Indexing the array: Moving values
* Write three statements to shift the array contents 1 position to the left. * The rightmost element should be assigned -1.

11 years ago

Solved


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 ...

11 years ago

Solved


Logical indexing: Player scores
Player 1 and player 2 take turns playing a game. Row array gameScores contains the scores of player 1, then player 2, then playe...

11 years ago

Solved


Double colon operator: Increment by x
* Construct a row array countValues from 0 to 25, elements incremented by incrementValue. Ex: If incrementValue is 5, countVa...

11 years ago

Solved


Integer indexing array: Reverse subsets
Construct an indexing array copySubset so that the statement reversedOrder = origOrder(copySubset); results in a row array begin...

11 years ago

Solved


Tree Height
Assign treeHeight with the tree height given the shadow length and angle of elevation. Simple geometry can compute the heigh...

11 years ago

Solved


Double colon operator: Counting up
* Construct a row array countValues from 1 to endValue, using the double colon operator. Ex: If endValue is 5, countValues s...

11 years ago

Solved


Integer indexing array: Weekend box office
The row array movieBoxOffice stores the amount of money a movie makes (in millions of $) for the 7 days of a week, starting with...

11 years ago

Solved


Test if a matrix is symmetric
Write a logical function that returns 1 if the input matrix is symmetric and 0 otherwise.

11 years ago

Solved


Indexing an array element
* Assign currentStudent with the second element of array testScores.

11 years ago

Solved


Double colon operator: Counting down
* Construct a row array countValues from startValue to endValue, elements decremented by -2 end Ex: If startValue is 10 and ...

11 years ago

Solved


Arithmetic array operations
* Add x to each element of array temperatureReadings.

11 years ago

Solved


Function definition: Volume of a pyramid
Define a function CalculatePyramidVolume with inputs baseLength, baseWidth, and pyramidHeight. The function returns pyramidVolum...

11 years ago

Solved


Multi-line comments
* Fix the syntax errors.

11 years ago

Solved


Comments
* Fix the syntax errors.

11 years ago

Solved


Computing Wind chill
On a windy day, a temperature of 15 degrees may feel colder, perhaps 7 degrees. The formula below calculates the "wind chill," i...

11 years ago

Load more