解決済み


Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


Back to basics 9 - Indexed References
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix and row and column, output the index of th...

約10年 前

解決済み


give nth decimal place of pi
max 15th place after the decimal point is ok for now

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

約10年 前

解決済み


Multi-line comments
* Fix the syntax errors.

約10年 前

解決済み


Coordinate geometry
Assign pointsDistance with the distance between point (x1, y1) and point (x2, y2). The distance is calculated by: Distance =...

約10年 前

解決済み


Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

約10年 前

解決済み


Find max
Find the maximum value of a given vector or matrix.

約10年 前

解決済み


Construct an array
* Construct an row array named observedValues with elements sensorReading1, sensorReading2, and sensorReading3.

約10年 前

解決済み


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

約10年 前

解決済み


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

約10年 前

解決済み


Population growth
Assign finalPopulation with the population size given an initial population, population growth rate, and number of years. The fi...

約10年 前

解決済み


Say something funny
Say something funny, or not. Your solution will be (fully automatically and objectively) scored based on how clever or funny ...

約10年 前

解決済み


Declaring a character
* Assign middleInitial with the character T.

約10年 前

解決済み


Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

約10年 前

解決済み


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

約10年 前

さらに読み込む