Risolto

Numbers spiral diagonals (Part 1)

Inspired by Project Euler n°28 et 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...

circa 5 anni fa

Risolto

The Matrix Construction

Given two input ,first one is CN (Column Number), Second one is Dim Can you produce such a matrix for example CN=6; Dim=2 ...

circa 5 anni fa

Risolto

Generate this matrix

For a given odd integer n, generate a matrix as follows: Input: n = 5; Output: [ 2 1 0 0 0 1 ...

circa 5 anni fa

Risolto

Matrix Construction I

Given n, construct a matrix as shown in the example below. Example For n=8, the output should look like this: 1 2 3 4 ...

circa 5 anni fa

Risolto

Matrix to vector transformation

given a matrix, make in the output 1 column vector putting odd numbers in ascending order after that put the even numbers in des...

circa 5 anni fa

Risolto

Basics - not so easy division

Please make a function whcih divides x/y, but pay attention for some exceptions with NaN,0,Inf. Sometimes return "ERROR" instead...

circa 5 anni fa

Risolto

Make one vector from two others

You are given two vectors of equal length. Your task is to create a MATLAB script that will repeat all of the values in the fir...

circa 5 anni fa

Risolto

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.

circa 5 anni fa

Risolto

Sum of adjacent elements in a vector

Given a vector v, return a vector s containting the sum of every two adjacent elements in the vector. Every element s(i) cont...

circa 5 anni fa

Risolto

Tax Calculator

Calculate the tax for a given income. 10% tax is paid for any income up to $2,000. 20% tax is paid for additional income u...

circa 5 anni fa

Risolto

Add a vector to a matrix

Given a matrix |mat| of size |mXn| and a row vector |v| of size |1Xs|, return a matrix with |m+1| rows that conatains |mat| over...

circa 5 anni fa

Risolto

Create a magic square matrix for a given odd integer

A magic square of size 'N' is a matrix that satisfies the following criterias: # Dimension - NxN # Matrix should contain ALL...

circa 5 anni fa

Risolto

How many Integers?

Count the integers in a given vector |v|. You *must* use a loop to count each element separately. Examples: Input: v...

circa 5 anni fa

Risolto

Triangle of numbers

Create a matrix with the integers from 1 to |n| arranged in a triangular shape. Every row |i| of the matrix contains |i| inte...

circa 5 anni fa

Risolto

The twelve days of Christmas

Traditionally there are twelve days of Christmas to celebrate ("Twelvetide"), typically starting with Christmas Day (25 December...

circa 5 anni fa

Risolto

Diagonal Pattern

For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...

circa 5 anni fa

Risolto

Diagonal Pattern

For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...

circa 5 anni fa

Risolto

I hope to lose weight healthily...

In order to reduce weight healthily, weight will be reduced by 4% every month. Please calculate how many months it will take...

circa 5 anni fa

Risolto

Add 3 (x<=100) Or Subtract 100 and add 3(100<x)

Add 3 to every element. However, if the value is greater than 100, subtract 100 and add 3. eg. input x = [45 106; 67 1...

circa 5 anni fa

Risolto

Product of Each Column

Given a matrix |mat| with |n| columns, return a row vector |v| of length |n|, where every element in |v| is the product of the |...

circa 5 anni fa

Risolto

Let's make puddings !

We will make puddings with eggs, milk and sugar. To make one pudding, we need one egg, 140(cc) of milk, 15 (g) of sugar. Now W...

circa 5 anni fa

Risolto

Jack's hand in "Titanic" ♤

Given a series of cards, return true if it's the famous hand. Note that i pretend that poker cards goes from 1 to 10 so be care...

circa 5 anni fa

Risolto

Remove the first, third and fifth rows of a matrix

Given a matrix x with at least five rows, return a matrix y that includes all rows of x except for th 1st, the 3rd and 5th. E...

circa 5 anni fa

Risolto

Problem 44444 !!! free beer everyone

just say hallelujah to solve this problem

circa 5 anni fa

Risolto

Eye Squared

For a positive integer |n| create the identity matrix with |n| elements. In case it is not possible to produce an identity ma...

circa 5 anni fa

Risolto

Find the average of a random sequance

Write a function that generates random integers within a loop, and calculates the mean of the positive numbers only. At each ...

circa 5 anni fa

Risolto

distance to a straight line (2D) given any 2 distinct points on this straight line

Given 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answ...

circa 5 anni fa

Risolto

Parallel vectors

Return true or false depending on whether 2 vectors are parallel or not. Vectors can be 2 or 3 dimensional. The origin is not c...

circa 5 anni fa