已解决


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

8 years 前

已解决


Linear-spaced points array
* Construct a row array plotPoints with 5 values that are spaced linearly from lowValue to highValue. Ex: If lowValue is 1 and ...

8 years 前

已解决


Indexing the array: Moving values
Assume sampleReadings always contains three elements. * Shift the array contents one position to the left. * The rightmost ...

8 years 前

已解决


Concatenating arrays
* Assign studentIDs with concatenated row arrays groupA and groupB

8 years 前

已解决


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

8 years 前

已解决


Indexing an array element
* Assign currentStudent with the second element of array testScores. _Reminder: Array indexing starts with 1._

8 years 前

已解决


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

8 years 前

已解决


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

8 years 前

已解决


Relational operators: Guessing game
Row array userGuess contains a sequence of user guesses. Create a logical indexing array correctGuess with true in each location...

8 years 前

已解决


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

8 years 前

已解决


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

8 years 前

已解决


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

8 years 前

已解决


Character variable: Compass direction
* Assign compassDirection with sensorReading's value. Both are character variables.

8 years 前

已解决


All your base are belong to us
Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

8 years 前

已解决


Function definition: Double down.
* Complete the DoubleDown function to return twice the initialValue.

8 years 前

已解决


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the hourly wage times 40 and times 50, because annualSalary = hour...

8 years 前

已解决


Compute total cost
A soda costs 2 dollars. A taco costs 3 dollars. Write a statement that assigns totalCost with the total meal cost given the numb...

8 years 前

已解决


Write an expression
Assigns finalResult with firstSample plus secondSample, squared, then divided by 3. Ex: If firstSample is 18 and secondSample is...

8 years 前

已解决


Multielement indexing of a row array
The row array birthRateChina stores the China birth rate (per 1000 people) for years 2000 to 2012. Write a statement that create...

8 years 前

已解决


Lightning strike distance: Writing a function
Write a function named LightningDistance that outputs "distance" given input "seconds". Seconds is the time from seeing lightnin...

8 years 前

已解决


Logic variables
* Assign isAvailable with true.

8 years 前

已解决


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

8 years 前

已解决


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

8 years 前

已解决


Given an unsigned integer x, find the largest y by rearranging the bits in x
Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

8 years 前

已解决


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

8 years 前

已解决


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

8 years 前

已解决


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

8 years 前

已解决


Indexing the last element: Print queue
* Delete the last element of row array printQueue.

8 years 前

已解决


Comments
* Fix the syntax errors.

8 years 前

已解决


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

8 years 前

加载更多