Gelöst


Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

mehr als 10 Jahre vor

Gelöst


Sorting
Assume that x is an n-by-2 matrix. The aim is to return the first column of x, but sorted according to the second column. Exa...

mehr als 10 Jahre vor

Gelöst


Cannon Ball
Given g (acceleration due to gravity) and desired altitude x, find the minimum ground velocity of a cannon ball to reach x.

mehr als 10 Jahre vor

Gelöst


High school cafeteria
Given an input vector of positive integers, return a row vector with the primes first (in increasing order) and the composites n...

mehr als 10 Jahre vor

Gelöst


03 - Matrix Variables 4
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3d.png>> A 3x4 NaN (Not a Number) matrix (Hint: use ...

mehr als 10 Jahre vor

Gelöst


Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


sum of first 'n' terms
Given n=10, find the sum of first 'n' terms Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these n=10 terms is 55...

mehr als 10 Jahre vor

Gelöst


Add two numbers
Add two numbers (For beginners)

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


Getting logical indexes
This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

mehr als 10 Jahre vor

Gelöst


Generate a NaN...on purpose
The goal is to create a function that will return a single "NaN" without using the nan function. I am interested to see how many...

mehr als 10 Jahre vor

Gelöst


Is the input divisible by 3?
Return true if the input is divisible by 3 and false if not.

mehr als 10 Jahre vor

Gelöst


Who invented zero?
We know the importance zero in computer science, mathematics... but who invented zero? Clue: He was the first in the line ...

mehr als 10 Jahre vor

Gelöst


Number of toolboxes?
Return a number equal to the number of toolboxes available to the Cody solvers.

mehr als 10 Jahre vor

Gelöst


Basics: 'Find the eigenvalues of given matrix
Find the eigenvalues y for a given matrix x.

mehr als 10 Jahre vor

Gelöst


Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.

mehr als 10 Jahre vor

Gelöst


Return area of square
Side of square=input=a Area=output=b

mehr als 10 Jahre vor

Gelöst


Which quadrant?
Given a complex number, output quadrant 'I' 'II' 'III' or 'IV' | II | I | ...

mehr als 10 Jahre vor

Gelöst


Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits. x=123045; x_vec=[1 2 3 0 4 5]; I happened upon a trick to do ...

mehr als 10 Jahre vor

Gelöst


power
Calculate power for given voltage and current

mehr als 10 Jahre vor

Gelöst


Average
Calculate the average of two numbers

mehr als 10 Jahre vor

Gelöst


Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

mehr als 10 Jahre vor

Gelöst


Min of a Matrix
Return the minimum value in the given matrix.

mehr als 10 Jahre vor

Gelöst


Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

mehr als 10 Jahre vor

Gelöst


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

mehr als 10 Jahre vor

Gelöst


Omit columns averages from a matrix
Omit columns averages from a matrix. For example: A = 16 2 3 13 5 11 10 8 9 7 ...

mehr als 10 Jahre vor

Gelöst


sum of non-primes
The sum of the non-primes below 10 is 1+4+6+8+9+10=38 Find the sum of all the non-primes below the input, N.

mehr als 10 Jahre vor

Gelöst


write an expression
output is five more than twice an input number.

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Mehr laden