Solved

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

3 mois ago

Solved

Convert a vector into a number

This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

3 mois ago

Solved

Matrix indexing with two vectors of indices

Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

3 mois ago

Solved

Find 100 from a Matrix and Replace With 0 with less computation time

pls use this matrix x = [208 40 167 180 112 70 192 215 90 19 231 100 9 100 97 100 ...

3 mois ago

Solved

Add two numbers

Calculate the sum of two numbers. Example input = [2 3] output = 5

3 mois ago

Solved

Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]

The given function returns the index of the maximum value in a given matrix. such as X=[4,3,4,5,9,12,0,5] Ans= 6 if maxim...

3 mois ago

Solved

Rotate a Matrix

Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise

3 mois ago

Solved

Determine Whether an array is empty

Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

3 mois ago

Solved

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

3 mois ago

Solved

Get the length of a given vector

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

3 mois ago

Solved

Double Fibonacci

double_fibonacci takes two integers, each greater than one, as input arguments (it does not have to check the format of the inpu...

3 mois ago

Problem

Double Fibonacci

double_fibonacci takes two integers, each greater than one, as input arguments (it does not have to check the format of the inpu...

3 mois ago | 0 | 12 solvers

Solved

Cancel Middle

Write a function called cancel_middle that takes A, an n-by-m matrix, as an input where both n and m are odd numbers an...

3 mois ago

Problem

Cancel Middle

Write a function called cancel_middle that takes A, an n-by-m matrix, as an input where both n and m are odd numbers an...

3 mois ago | 0 | 10 solvers

Solved

Double Fibonacci

double_fibonacci takes two integers, each greater than one, as input arguments and returns a two-dimensional array. If it is cal...

3 mois ago

Solved

Column norms of a matrix

Given a matrix M, return a vector y such that for each k y(k)=norm(M(:,k)) (y(k) is the Euclidean norm of the k-th col...

3 mois ago

Solved

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

3 mois ago

Solved

Prime numbers between a , b.

Find all prime number between a & b (including a and b). example: a=100 b=120 y= [101 103 107 109 113]

3 mois ago

Solved

Remove the two elements next to NaN value

The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

3 mois ago

Solved

Clean the List of Names

Given a list of names in a cell array, remove any duplications that result from different capitalizations of the same string. So...

3 mois ago

Solved

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

3 mois ago

Solved

Sum of the Matrix Elements

Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns. E...

3 mois ago

Solved

Sum of diagonals

Compute the sum of diagonal elements of a square matrix and store the larger sum to s. Eg : a = [1 2 3; 2 3 4; 4 5 10] ...

3 mois ago

Solved

Too Many Zeros, Dump Them!

Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...

3 mois ago

Submitted

Scanning a matrix in zigzag order into a vector.

zigzag.m takes a matrix as the only input and returns a vector containing the entries of the matrix in "ZIGZAG" fashion.

3 mois ago | 1 download |

Solved

matrix zigzag

Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

3 mois ago

Solved

radius of a spherical planet

You just measured its surface area, that is the input.

8 mois ago

Solved

How to subtract?

*± ± ± ± ± ± ± ± ± ± ±* * Imagine you need to subtract one...

8 mois ago