Risolto


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

circa 6 anni fa

Risolto


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

circa 6 anni fa

Risolto


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

circa 6 anni fa

Risolto


Convert from Fahrenheit to Celsius
Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

circa 6 anni fa

Risolto


Return median of a matrix
Compute median of a matrix of any dimension. Exclude the NaNs if any.

circa 6 anni fa

Risolto


find number of times of occurrence of the most frequent number in a row vector
In a given row vector, find the number of times a mode of a row vector has occurred example: in [2 5 5 5 5 3], output is 4 ...

circa 6 anni fa

Risolto


Product of all elements in an array
Compute the product of all elements in an array.

circa 6 anni fa

Risolto


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

circa 6 anni fa

Risolto


Square a Number
Given an input x, return y, which is equal to the square of x.

circa 6 anni fa

Risolto


Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.

circa 6 anni fa

Risolto


Min of a Matrix
Return the minimum value in the given matrix.

circa 6 anni fa

Risolto


Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346

circa 6 anni fa

Risolto


Converting binary to decimals
Convert binary to decimals. Example: 010111 = 23. 110000 = 48.

circa 6 anni fa

Risolto


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

circa 6 anni fa

Risolto


Create a vector
Create a vector from 0 to n by intervals of 2.

circa 6 anni fa

Risolto


Penny flipping - calculate winning probability (easy)
Two players are playing a fair penny flipping game. For each flip, the winner adds one penny from the loser's collection to his/...

circa 6 anni fa

Risolto


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

circa 6 anni fa

Risolto


BASICS - sum part of vector
Please make a function, where as input you get vector "x" and and vector "c", where in "c" vector you get indexes to sum. Examp...

circa 6 anni fa

Risolto


Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

circa 6 anni fa

Risolto


Make roundn function
Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...

circa 6 anni fa

Risolto


Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

circa 6 anni fa

Risolto


Armstrong Number
Determine whether the given input n-digit number is Armstrong Number or not. Return True if it is an Armstrong Number. An n-D...

circa 6 anni fa

Risolto


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

circa 6 anni fa

Risolto


Return the first and last character of a string
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

circa 6 anni fa

Risolto


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

circa 6 anni fa

Risolto


Calculate Amount of Cake Frosting
Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

circa 6 anni fa

Risolto


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

circa 6 anni fa

Risolto


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

circa 6 anni fa

Risolto


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

circa 6 anni fa

Risolto


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

circa 6 anni fa

Carica altro