Gelöst


Equal to their cube
Tell me three real numbers that are equal to their cubes?

mehr als 10 Jahre vor

Gelöst


Create matrix of replicated elements
Given an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. Example: Input: ...

mehr als 10 Jahre vor

Gelöst


Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


03 - Matrix Variables 5
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3e.png>>

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Determine if a Given Number is a Triangle Number
*Description:* Determine if the elements of an input array are triangle numbers and return the result as an array with the sa...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Geometric series
Find the sum, given the first term t1, the common ratio r, and number of terms n. Examples If input t1=1, r=1, n=7 the...

mehr als 10 Jahre vor

Gelöst


Back to basics 13 - Input variables
Covering some basic topics I haven't seen elsewhere on Cody. Return as a string the name of the input variable to the functio...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Matrix which contains the values of an other matrix A at the given locations.
If you have two matrices, which together give xc and yc coordinates into another matrix, eg : xc = [1 1 1; 2 2 1]; ...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Multi-line comments
* Fix the syntax errors.

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


No Twins?
Write a function that accepts as input a vector and returns the same vector, but retaining only the first occurrence of an eleme...

mehr als 10 Jahre vor

Gelöst


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

mehr als 10 Jahre vor

Gelöst


Given a 4x4 matrix, swap the two middle columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

mehr als 10 Jahre vor

Gelöst


Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

mehr als 10 Jahre vor

Gelöst


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

mehr als 10 Jahre vor

Gelöst


Count up then down
Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

mehr als 10 Jahre vor

Gelöst


Matrix indexing with two vectors of indices
Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


02 - Vector Variables 5
_eVec_ = _Hello_ ( _eVec_ is a string, which is a vector of characters )

mehr als 10 Jahre vor

Gelöst


02 - Vector Variables 4
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2d.png>> (Logarithmically spaced numbers between 1 and 1...

mehr als 10 Jahre vor

Gelöst


03 - Matrix Variables 2
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3b.png>> A 9x9 matrix of zeros, but with the following v...

mehr als 10 Jahre vor

Gelöst


Output any real number that is neither positive nor negative
Output any real number that is neither positive nor negative

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Mehr laden