Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


Add two numbers
Add two numbers (For beginners)

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


power
Calculate power for given voltage and current

oltre 10 anni fa

Risolto


Average
Calculate the average of two numbers

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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.

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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.

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

Carica altro