Gelöst


Replace every 3rd element in a vector with 4
x is a vector of undetermined length You are to replace every 3rd element with the number 4, example: x = [11 23 34 43 2 3...

3 Monate vor

Gelöst


Matlab Basics II - Extract last 3 elements of a vector
Let x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives t...

3 Monate vor

Gelöst


Find out value of sine given by degree.
Find out value of sine given by degree. If theta=30, it's value must be 0.5.

3 Monate vor

Gelöst


Skip by a multiple
Given an integer create an array of its multiples. Array must have a length of 15

3 Monate vor

Gelöst


Find out total non zero element of matrix
Find out Non zero element of matrix A=magic(5) 17 24 1 8 15 23 5 7 14 16 4 6...

3 Monate vor

Gelöst


Change string to number
Change given string to number. (hint: there is already function) Changing from ['1234'] to [1234] is one of example

3 Monate vor

Gelöst


Create a Matrix of Zeros
Given an input x, create a square matrix y of zeros with x rows and x columns.

3 Monate vor

Gelöst


Sum of integers numbers
Sum of the numbers from 1 to 100

3 Monate vor

Gelöst


Sum the squares of numbers from 1 to n
For a given value of n return the sum of square of numbers from 1 to n. Example For n = 2 then sum of squares = 5 (1^2 + ...

3 Monate vor

Gelöst


Area of a circle
Given the radius x, y would be the area of a circle. Pi = 3.1416

3 Monate vor

Gelöst


square root
Find the square root (y) of an input (x).

3 Monate vor

Gelöst


find radius of cone
if Slant height of Cone(I)& hight of Cone(H) given then find radius of the Cone(R) for example I=5,h=4 then the ans R=3;

3 Monate vor

Gelöst


Remove the positive integers.
Given array x (of integers), remove all the positive numbers and display ouput as y. Example x=[1 -2 3 -4] , output is y=[-2 -...

3 Monate vor

Gelöst


Temperature conversion
Convert temperature in degrees Celsius (C) to temperature in degrees Kelvin (K). Assume your answer is rounded to the nearest Ke...

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


Negative matrix
Change the sign of all elements in given matrix.

3 Monate vor

Gelöst


Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input is n=4 th...

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


Count number of words in string
Count number of words in string Examples 'hi', answer is 1 'hi hi', answer is 2 'I enjoy cody', answer is 3

3 Monate vor

Gelöst


Transpose of matrix
Transpose of matrix as per test cases

3 Monate vor

Gelöst


Append two matrix as shown below example
Append two matrix as shown below example A=[1 2; 3 4] and B=[5 6;7 8] Answer must be 1 2 5 6 3...

3 Monate vor

Gelöst


Matlab Basics II - Minimum
Write a function that returns the minimum of each ROW of a matrix x example: x = [1 2 3; 4 5 6]; output [1;4];

3 Monate vor

Gelöst


Create an index-powered vector
Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

3 Monate vor

Gelöst


Back to basics - mean of corner elements of a matrix
Calculate the mean of corner elements of a matrix. e.g. a=[1 2 3; 4 5 6; 7 8 9;] Mean = (1+3+7+9)/4 = 5

3 Monate vor

Gelöst


Is the Point in a Triangle?
Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x2, y...

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


Matlab Basics - Convert a row vector to a column vector
Write a script to convert a row (e.g. x = [1 2 3]) to a column (e.g. y = [1;2;3]), your script should be able to do this for any...

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


Return a list sorted by number of occurrences
Given a vector x, return a vector y of the unique values in x sorted by the number of occurrences in x. Ties are resolved by a ...

3 Monate vor

Mehr laden