Solved


How many jokers?
* Given DNA codes of a group of suspects, * and a code for certain types of jokers, * Count how many jokers of that type. * ...

8 years ago

Solved


While loop with multiple conditions
Write a while loop that multiplies userValue by 2 while userValue is not 10 and while userValue is less than 25.

8 years ago

Solved


Matlab Basics - y as a function of x
write a script to calculate y as a function of x, such that y = 6x^2 + 5x - 2

8 years ago

Solved


Matlab Basics - Create a row vector
Write a Matlab script to create a row vector of 10 consecutive numbers x = [1 2 3 4 5 6 7 8 9 10]

8 years ago

Solved


Matlab Basics - Absolute Value
Write a script that returns the absolute value of the elements in x e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]

8 years ago

Solved


Matlab Basics - Sum a vector
Write a script to add up all the elements in a vector e.g. x = [1 2 3 4] --> output = 10

8 years ago

Solved


Matlab Basics - Rounding I
Write a script to round x DOWN to the next lowest integer: e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2

8 years ago

Solved


Matlab Basics - Convert a row vector to a column vector
Write a script to convert a row (e.g. x = [1 2 3]) to a column (e.g. y = [1;2;3]), your script should be able to do this for any...

8 years ago

Solved


While loop with branching
Write a while loop that adjusts userValue while userValue is less than 0 or greater than 80. If userValue is greater than 80, th...

8 years ago

Solved


poll: would you like the regexp (?@cmd) functionality to be banned in Cody?
This problem is a poll (and a little bit of "white hat hacktivism" as well) regarding Cody users sentiment about the use of rege...

8 years ago

Solved


Concatenating strings
* Write a statement that assigns fullName with firstName, a space, then lastName. Ex: If firstName is Alan and lastName is Tu...

8 years ago

Solved


Comparing floating point values
* Assign matchFound with true if firstSample and secondSample are less than thresholdValue.

8 years ago

Solved


Function definition: BMI calculator
Define a function CalculateBMI with inputs massKg and heightCm. The function returns bodyMassIndex. The function should be able ...

8 years ago

Solved


Beginner's Problem - Squaring
Try out this test problem first. Given the variable x as your input, square it by two and put the result in y. Examples: ...

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

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

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

8 years ago

Solved


Constructing strings
* Construct a string alphaString from 'a' to endLetter, using the double colon operator. Ex: If endLetter = 'e', then alphaSt...

8 years ago

Solved


Is my wife really right?
For every input, output the string 'yes' once. Example: [yes1, yes2] = YesSheIs('Am I right?', 'Do you love me?') yes1 = '...

8 years ago

Solved


Create formatted value string Cell array of a vector
This Challenge is to create a cell array that contains strings of vector components in a given format. c=vector2formattedstri...

8 years ago

Solved


Raise a polynomial to a power
In Matlab, polynomials are represented by a vector of coefficients. For example, the polynomial p=a*x^2 + b*x + c is represente...

8 years ago

Solved


"Power matrix" of two vectors
Given two row vectors x,y of lengths m and n (respectively), create an m x n matrix whose i,j entry is x(i)^y(j).

8 years ago

Solved


How many ways to write a number
Given two positive numbers n and k, where n>=k. In how many ways can we write n as sum of k positive numbers. Same numbers but d...

8 years ago

Solved


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

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

8 years ago

Solved


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

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

8 years ago

Solved


Adding an element: Ticker tape
* Add stockPrice to the beginning of row array tickerTape

8 years ago

Solved


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

8 years ago

Load more