Risolto


Flip the diagonal values
Write a program that flip the elements of main diagonal , upper and lower diagonal values of a sqare matrix. For example if a ...

9 mesi fa

Risolto


swap sign sum & multiply castles
It is an easy problem, if you know the answer. Given a square matrix of NxN ordinary numbers. Initially place N identical indi...

9 mesi fa

Risolto


Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

9 mesi fa

Risolto


Half-Swap
Given a vector with an even number of elements, rearrange it so that the elements in its first half are switched with those i...

9 mesi fa

Risolto


Flip the bit
Given an input character string (e.g. '1001'), return a character string with the bits flipped ('0110').

9 mesi fa

Risolto


Matlab Basics - Switching Assignments
Switch assignments for variables x and y, for example start with x = 1 and y = 3 end with y = 1 and x = 3 Do NOT simply r...

9 mesi fa

Risolto


Remove a specific character with another
Remove any (-) dash sign with (_) underscore Ex = 'The-Journey-of-thoudsands-miles-starts-with-a-single-step' y = 'The_Jour...

9 mesi fa

Risolto


Swap between columns
The idea is to swap between second and second last column Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; ...

9 mesi fa

Risolto


Swap between first and last
The idea is to swap between first and last row Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; ...

9 mesi fa

Risolto


Swap between rows
The idea is to swap between second and second last row Ex = [1 2 3 4 5; 5 4 3 2 1; 1 2 3 4 5; 1 2 3 4 5; ...

9 mesi fa

Risolto


Swap between first and last column
The idea is to swap between first and last column Ex = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5; 1 2 3 ...

9 mesi fa

Risolto


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

9 mesi fa

Risolto


Convert a numerical matrix into a cell array of strings
Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

9 mesi fa

Risolto


String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values
<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

9 mesi fa

Risolto


Remove element(s) from cell array
You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

9 mesi fa

Risolto


Convert a Cell Array into an Array
Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

9 mesi fa

Risolto


Cell Counting: How Many Draws?
You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

9 mesi fa

Risolto


Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

9 mesi fa

Risolto


Number of Even Elements in Fibonacci Sequence
Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

9 mesi fa

Risolto


Circumscribed circles
Given the lengths of the 3 sides of a triangle, output the radius of the circumscribed circle. Example: [3 4 5] -> 2.5

9 mesi fa

Risolto


Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...

9 mesi fa

Risolto


Back to basics 14 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of all MATLAB keywords

9 mesi fa

Risolto


Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

9 mesi fa

Risolto


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

9 mesi fa

Risolto


Find the nearest integer
Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

9 mesi fa

Risolto


Add a row of zeros on top of a matrix
Given a matrix, insert a row of zeros as the top row.

9 mesi fa

Risolto


Solve Linear equations
Solve Linear equations Example: x+y=2 and x+2y=3, then x and y equal to 1.

9 mesi fa

Risolto


Find out magnitude of vector
Find out magnitude of vector. Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2) Please don't use sum function. If you l...

9 mesi fa

Risolto


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

9 mesi fa

Risolto


Summation of array
Given an array, Find the sum of all of the elements in it Examples: Input x = [1 2 3 5; 4 5 6 7]; Output y is 33

9 mesi fa

Carica altro