A résolu


Square the input
Given a scalar or vector x, return the square of each element. Example x = [7 2] answer = [49 4]

5 mois il y a

A résolu


Colon operator of two vectors
You are given two vectors of equal length: VecStart, VecEnd Each vector contain a set of integers, where VecEnd(j)>=VecStar...

5 mois il y a

A résolu


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

5 mois il y a

A résolu


Mode
Find the mode of the vector Assumption: no vector is bimodal Example 1: input=[1 2 3 4 4]; output=4 Example 2: input=[7...

5 mois il y a

A résolu


Matrix multiplication across rows
Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix Example ...

5 mois il y a

A résolu


Sum of odd numbers in a matrix
Find the sum of all the odd numbers in a matrix. Example x = [2 3 5 7 1 4 11] y = 27

5 mois il y a

A résolu


Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...

5 mois il y a

A résolu


Matrix rotation as per given angle
Given a user defined matrix and angle of rotation, rotate the elements of output matrix as clockwise or anti-clockwise. Angle wi...

5 mois il y a

A résolu


Complex transpose
Calculate the transpose of a matrix having complex numbers as its elements without changing the signs of the imaginary part. ...

5 mois il y a

A résolu


Matrix to column conversion
Given a matrix of any size, convert it into a column vector. e.g A=[10 20 30; 40 50 60] then, B = [10; 40; ...

5 mois il y a

A résolu


Sum of diagonals elements of a matrix
Given a matrix, return the sum of all the elements across the diagonals. E.g. A = [1 2 3; 4 5 6; 7 8 9;...

5 mois il y a

A résolu


Power of n ?
Determine if x (positive integer) is a power of n, return true or false accordingly.

5 mois il y a

A résolu


Matlab Basics II - Max & Index of Max
Write a function that takes a vector x, then returns both the max value in x and its location in the vector for example x ...

5 mois il y a

A résolu


Tiling a matrix
Given a matrix and a number of columns, replicate matrix in a single row

5 mois il y a

A résolu


Check if integer
Given a vector of elements, determine if each element is an integer and return true or false accordingly.

5 mois il y a

A résolu


Check if equal
Return true if all the elements of an nD array are equal, false otherwise.

5 mois il y a

A résolu


sum of non-primes
The sum of the non-primes no larger than 10 is 1+4+6+8+9+10=38 Find the sum of all the positive non-prime integers that do no...

5 mois il y a

A résolu


Back to basics 15 - Benchmark
Covering some basic topics I haven't seen elsewhere on Cody. Return an array of the benchmark values for MATLAB.

5 mois il y a

A résolu


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

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

5 mois il y a

A résolu


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

5 mois il y a

A résolu


Cumulative product of a vector
Cumulative product of a vector example x=[1 2 5 10], then answer must be [ 1 2 10 100] *If you like this prob...

5 mois il y a

A résolu


ASCii Code
Using Matlab get the ASCii for '?'

5 mois il y a

A résolu


Counting down
Create a vector that counts from 450 to 200 in increments of 10.

5 mois il y a

A résolu


ASCii Code
Using matlab, give the symbol that is associated with ASCii code 122

5 mois il y a

A résolu


Draw a 'Z'.
Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ . Example: n=5 ans= [1 1 1 1 1 0 0 0 1 ...

5 mois il y a

A résolu


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

5 mois il y a

A résolu


Matlab Basics - Rounding I
Write a script to round x DOWN to the next lowest integer: e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2

5 mois il y a

A résolu


Convert degrees to radians
Given input in degrees, output to radians

5 mois il y a

A résolu


Matlab Basics - Absolute Value
Write a script that returns the absolute value of the elements in x e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]

5 mois il y a

Charger plus