Risolto


Logical indexing: High scores
Row array gameScores contains all player scores. Construct a row array highScores than contains all player scores greater than 5...

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


Comments
* Fix the syntax errors.

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


Declaring a string
* Assign streetAddress with the string 1313 Mockingbird Lane.

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...

oltre 10 anni fa

Risolto


Create a square matrix of multiples
Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row. This also applies...

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples : n=2, A=[1 2 3] -> [1 1 2 2 3 3] n=0...

oltre 10 anni fa

Risolto


Filter AC, pass DC
Input x is the sampled signal vector, may have both AC and DC components. Output vector y should not contain any AC component. ...

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


Declaring a character
* Assign middleInitial with the character T.

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise Examples: 'Macbeth' -> false 'Publius Cor...

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


Back to basics 15 - classes
Covering some basic topics I haven't seen elsewhere on Cody. Return the class of the input variable.

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


So many choices
For inputs _n_ and _k_ (in that order), output the number of ways that k objects can be chosen from amongst n distinct objects. ...

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


Logic variables
* Assign isAvailable with true.

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Carica altro