Feeds
已解决
Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...
2 years 前
已解决
Basics: 'Find the eigenvalues of given matrix
Find the eigenvalues y for a given matrix x.
2 years 前
已解决
Unique - Very Very Large Numbers
Given a vector column, with some very large numbers, create the ascending sort and unique vector. *Input:* A (column vector)...
2 years 前
已解决
Create a matrix from a cell
In this problem , you must convert a cell into a matrix and pad each cell with NaN. *Example 1:* If you have the input...
2 years 前
已解决
Combinations without using nchoosek
You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...
2 years 前
已解决
Soccer - TOTO
How many different outcomes are there in a soccer-TOTO with n games? For each game there are three results: win - loss - equa...
2 years 前
已解决
arrangement of symbols
There are n different symbols in which m symbols are identical (m<n). How many different arrangement can we make with these symb...
2 years 前
已解决
Convert from Base 10 to base 5
Convert the input number from base 10 into base 5: for example: if a(in base 10)= 5 then a(in base 5)= 10
2 years 前
已解决
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 ...
2 years 前
已解决
Replace Vector Elements
Replace all elements in a vector which are equal to or smaller than zero with 0.1. Example: A = [1 2 3 -1 0 2 -3 -80]; ...
2 years 前
已解决
Remove white space from the string
Remove the white spaces (trailing and leading) from the input variable
2 years 前
已解决
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 ...
2 years 前
已解决
Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];
2 years 前
已解决
Angle between Two Vectors
The dot product relationship, a dot b = | a | | b | cos(theta), can be used to determine the acute angle between vector a and ve...
2 years 前
已解决
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
2 years 前
已解决
Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.
2 years 前
已解决
Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...
2 years 前
已解决
root?
* Given a function 'foo', and a position 'there', find the root near 'there'. * For example: If foo=@sin, and there=3.1, then r...
2 years 前
已解决
Find the largest value in the 3D matrix
Given a 3D matrix A, find the largest value. Example >> A = 1:9; >> A = reshape(A,[3 1 3]); >> islargest(A) a...
2 years 前
已解决
Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...
2 years 前
已解决
Replace May with April
For instance, if the input is input_str = 'The flowers may bloom in April'; then the output is output_str = 'The flo...
2 years 前
已解决
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
2 years 前
已解决
Indirect 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...
2 years 前
已解决
Back to basics 16 - byte order
Covering some basic topics I haven't seen elsewhere on Cody. Switch the byte order of the input (i.e. if little-endian -> big...
2 years 前
已解决
Back to basics 15 - classes
Covering some basic topics I haven't seen elsewhere on Cody. Return the class of the input variable.
2 years 前
已解决
commutative?
Given the handle to a binary function that takes two ordinary numbers, test if the function is commutative.
2 years 前
已解决
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...
2 years 前
已解决
Back to basics 5 - Clipboard
Covering some basic topics I haven't seen elsewhere on Cody. Copy the input string to the clipboard
2 years 前
已解决
Back to basics 3 - Temp Directory
Covering some basic topics I haven't seen elsewhere on Cody. Return a string that is the path to the system's current temp di...
2 years 前

