Gelöst


Beat the test suite if you can :)
Solve this problem based on clues in the test suite.

etwa 5 Jahre vor

Gelöst


Display negative numbers
Given array,x, display all the negative numbers and display output as y. Example x=[1 -2 3 -4] , output is y=[-2 -4].

etwa 5 Jahre vor

Gelöst


Shift elements of vector left
Shift elements of vector to the left. For ex. : Input_vec = [1 2 3 4 5] Output_vec = [2 3 4 5 1]

etwa 5 Jahre vor

Gelöst


Calories in a slice of pizza?
The total calories C in a pizza is printed on its box. You know the angle A (degrees) of the slice you placed on your plate. Ple...

etwa 5 Jahre vor

Gelöst


Matrix element wise multiplication
Take two incoming vectors, and multiply them element wise

etwa 5 Jahre vor

Gelöst


Sort rows of a matrix
Sort rows of matrix A in an ascending order according to the last column Example input: A = [1 2 3;7 8 9;4 5 6]; Exam...

etwa 5 Jahre vor

Gelöst


Create sine function out of cosine
Please don't use sin(x) directly

etwa 5 Jahre vor

Gelöst


Find minimum and maximum elements of an array
For a given array find minimum and maximum elements of an array and store minimum value in first index of output and maximum in ...

etwa 5 Jahre vor

Gelöst


Find the sum of the largest two elements in a vector
With this one, you have to find the two largest elements in a vector and output the sum of those numbers.

etwa 5 Jahre vor

Gelöst


De-primed
Write a function that will multiply every prime number in the array or matrix by two, leaving all other numbers the same, and re...

etwa 5 Jahre vor

Gelöst


Check if a matrix is a palindrome in all directions
Check if a matrix is a palindrome both vertically and horizontally. You function will return *true* for |[1,2,1]| or |[2,7,2;...

etwa 5 Jahre vor

Gelöst


Find the last digit
FInd the last digit of a given number. Given number is the input and output should be the last digit of that number.

etwa 5 Jahre vor

Gelöst


Give prime Numbers upto n
You are given a input number x; print all the prime numbers less than equal to x.

etwa 5 Jahre vor

Gelöst


Flipping a Matrix
Flipping matrix up and down. If a central row is exists, leave it, and flip remaining rows. Example Mat = magic(3) ...

etwa 5 Jahre vor

Gelöst


create a square matrix
create a [n*n] matrix. example: mat(4)= [ 1 4 9 16 4 4 9 16 9 9 ...

etwa 5 Jahre vor

Gelöst


Swap the first and last columns (★★)
(copy of Prob 19) Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becom...

etwa 5 Jahre vor

Gelöst


Resizing Matrices
Take an 4x3 matrix, and resize it to a 2x6 matrix

etwa 5 Jahre vor

Gelöst


Create an array (n,n) where only diagonal elements are '1' and others are '0'
Create an array (n,n) where only diagonal elements are '1' and others are '0' EX: n = 3; then Resultant array would be [ 1 0...

etwa 5 Jahre vor

Gelöst


Find the mean of two vectors
Take two vectors, and output the mean of them (bonus if you don't use the in-built mean function)

etwa 5 Jahre vor

Gelöst


Vector Element Multiplication
Take two incoming vectors, and output the element wise multiplication of the vectors.

etwa 5 Jahre vor

Gelöst


Weighted average
Compute the weighted average Y, of the vector A, given the weight vector W. The weighted average is the sum of the dot produc...

etwa 5 Jahre vor

Gelöst


UICBioE240 problem 1.7
Find the other two angles of a right triangle given the two of the sides. So if A = [1 1] B = [45 45]

etwa 5 Jahre vor

Gelöst


Evened up (or not)
You will be provided with an array or matrix that contains various numbers, in addition to an evening variable, e, set to 1 or 0...

etwa 5 Jahre vor

Gelöst


Create a block diagonal matrix
A block diagonal matrix is a square matrix that can be written as A = [a 0 0 0 0 b 0 0 0 0 c 0 ...

etwa 5 Jahre vor

Gelöst


Vector to 3-Column Matrix
Consider a vector *A* such as A = [1 2 3 3 4 5 6] Can you convert this vector to a three-column matrix like this: ...

etwa 5 Jahre vor

Gelöst


row removal
Remove the nth row from input matrix M and return the resulting matrix in output N.

etwa 5 Jahre vor

Gelöst


Replace 0 to NaN!
In given matrix A=[1 nan nan; 2 2 nan; nan nan 1]; replace NaN to 0. Use matrix A as a input.

etwa 5 Jahre vor

Gelöst


Sum positive elements of matrix.
Calculate sum of positive elements of the matrix.

etwa 5 Jahre vor

Gelöst


Find x in provided equation!
x^2-2*x+1=0 This polynomial can be expressed by using each term's coefficients, such as [1 -2 1]. Using the polynomial ...

etwa 5 Jahre vor

Gelöst


Replace Negative(-) by 0 and positive by 1
In a given Matrix Replace all element having *Negative sign with 0* and *Positive elements with 1* .

etwa 5 Jahre vor

Mehr laden