解決済み


Arrange vector in ascending order
Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

約11年 前

解決済み


Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

約11年 前

解決済み


Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component. Examp...

約11年 前

解決済み


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

約11年 前

解決済み


Duplicates
Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

約11年 前

解決済み


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

約11年 前

解決済み


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

約11年 前

解決済み


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

約11年 前

解決済み


Back to basics 25 - Valid variable names
Covering some basic topics I haven't seen elsewhere on Cody. Given a string, return true if it is a valid MATLAB variable nam...

約11年 前

解決済み


Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

約11年 前

解決済み


Back to basics 15 - classes
Covering some basic topics I haven't seen elsewhere on Cody. Return the class of the input variable.

約11年 前

解決済み


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

約11年 前

解決済み


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

約11年 前

解決済み


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.

約11年 前

解決済み


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

約11年 前

解決済み


Function Iterator
Given a handle fh to a function which takes a scalar input and returns a scalar output and an integer n >= 1, return a handle f...

約11年 前

解決済み


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

約11年 前

解決済み


Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

約11年 前

解決済み


Solve the Sudoku Row
*Description* A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...

約11年 前

解決済み


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

11年以上 前

解決済み


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

12年弱 前

解決済み


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

12年弱 前

解決済み


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

12年弱 前

解決済み


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

12年弱 前

解決済み


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

12年弱 前

解決済み


given 3 sides, find area of this triangle
1:3 -> 0; 3:5 -> 6

12年弱 前

解決済み


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

12年弱 前

解決済み


Extract leading non-zero digit
<http://en.wikipedia.org/wiki/Benford%27s_law Benford's Law> states that the distribution of leading digits is not random. This...

12年弱 前

解決済み


Love triangles
Given a vector of lengths [a b c], determines whether a triangle with non-zero area (in two-dimensional Euclidean space, smarty!...

12年弱 前

解決済み


Sums with Excluded Digits
Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...

12年弱 前

さらに読み込む