A résolu


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

presque 9 ans il y a

A résolu


Back to basics 1 - Saving
Covering some basic topics I haven't seen elsewhere on Cody. Given an input variable 'x', save it to disk in a file named 'co...

presque 9 ans il y a

A résolu


Back to basics 10 - Max Float
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive floating-point number MATLAB can han...

presque 9 ans il y a

A résolu


Rotate a Matrix by 90 degrees
Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

presque 9 ans il y a

A résolu


Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

presque 9 ans il y a

A résolu


Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

presque 9 ans il y a

A résolu


Back to basics 12 - Input Arguments
Covering some basic topics I haven't seen elsewhere on Cody. Return a value equal to the number of input arguments to the fun...

presque 9 ans il y a

A résolu


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

presque 9 ans il y a

A résolu


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

presque 9 ans il y a

A résolu


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

presque 9 ans il y a

A résolu


Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...

presque 9 ans il y a

A résolu


Back to basics 11 - Max Integer
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

presque 9 ans il y a

A résolu


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

presque 9 ans il y a

A résolu


Program an exclusive OR operation with logical operators
Program an exclusive or operation *without* using the MATLAB function xor. Use logical operators like |, &, ~, ... instead. ...

presque 9 ans il y a

A résolu


Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

presque 9 ans il y a

A résolu


All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

presque 9 ans il y a

A résolu


Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

presque 9 ans il y a

A résolu


Return the first and last character of a string
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

presque 9 ans il y a

A résolu


surface of a spherical planet
you just discovered its circumference, that is the input.

presque 9 ans il y a

A résolu


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

presque 9 ans il y a

A résolu


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

presque 9 ans il y a

A résolu


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

presque 9 ans il y a

A résolu


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

presque 9 ans il y a

A résolu


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

presque 9 ans il y a

A résolu


Lightning strike distance: Writing a function
Write a function named LightningDistance that outputs "distance" given input "seconds". Seconds is the time from seeing lightnin...

presque 9 ans il y a

A résolu


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

presque 9 ans il y a

A résolu


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

presque 9 ans il y a

A résolu


Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

presque 9 ans il y a

A résolu


Pizza value using expression with parentheses
Pizza prices are typically listed by diameter, rather than the more relevant feature of area. Compute a pizza's value (cost per ...

presque 9 ans il y a

A résolu


Create a row array using double colon operator
Create a row array from 9 to 1, using the double colon operator.

presque 9 ans il y a

Charger plus