Risolto


Given a matrix A (size m x n) create a matrix B (size m+2 x n+2) which consists of matrix A surrounded by zeros. See Example below:
A = [1 2 3 4 5 6] ----------- B = [0 0 0 0 0 0 1 2 3 0 0 4 5 6 0 0 0 0 0 0]

circa 2 anni fa

Risolto


Given a Vector v1, create v2 which is the sum of each two adjacent elements in v1. {length(v2)=length(v1)-1}
if v1 is [1 2 3 4 5 6 7 8] then v2 should be [3 5 7 9 11 13 15]. if v1 is [1; 3; 5; 7] the...

circa 2 anni fa

Risolto


Given a matrix A (size m x n) create a matrix B which consists of matrix A sorted in descending order by columns and then by rows.
--------------- A= [ 2 6 -3 7 12 0 -12 5 1] --------------- B= [12 7 1 6 2 0 5 -3 ...

circa 2 anni fa

Risolto


Given a matrix A return a vector of the product of the elements in each column using a loop without using prod.
--------------------- for m: 3 1 3 3 10 1 9 1 9 4 1 4 5 6 5 ...

circa 2 anni fa

Risolto


Horizontal matrix sort
Given a matrix x with n rows and m columns, return a matrix y with n rows and 2m columns, such that every row in x is sorted fro...

circa 2 anni fa

Risolto


Separate even from odd numbers in a vector - with a loop
*Using a loop*, rearrange a vector of integers such that the odd numbers appear at the beginning, and even numbers at the end. T...

circa 2 anni fa

Risolto


Average of even-numbered columns
Given a vector, find the average of even-numbered columns. e.g x = [ 4 6 8 9 1 2 7 ] y = ( 6 + 9 + 2 ) / 3

circa 2 anni fa

Risolto


determine the sum of decimal part for given matrix
determine the sum of fraction part for the given matrix

circa 2 anni fa

Risolto


"Power matrix" of two vectors
Given two row vectors x,y of lengths m and n (respectively), create an m x n matrix whose i,j entry is x(i)^y(j).

circa 2 anni fa

Risolto


Divisible by n, prime divisors from 20 to 200
Pursuant to the previous problem (linked below), this problem requires a function that checks for divisibility of large numbers ...

circa 2 anni fa

Risolto


Divisible by n, Composite Divisors
Pursuant to <http://www.mathworks.com/matlabcentral/cody/problems/42453-divisible-by-n-prime-vs-composite-divisors Divisible by ...

circa 2 anni fa

Risolto


Divisible by n, Truncated-number Divisors
Some divisors only require a few numbers at the end of the number in question to determine divisibility, no matter how long. Exa...

circa 2 anni fa

Risolto


Leader
An element of a list is called a "leader" if every element to its right (and not just the one immediately to its right) is stric...

circa 2 anni fa

Risolto


That's some divisor you've got there...
Given a positive integer x, calculate the sum of all of the divisors of the number. Please include the number itself in your fi...

circa 2 anni fa

Risolto


Repeat middle rows and columns of an array
Given an MxN numeric array (A), return an array (B) in which the middle rows and columns have each been repeated once. It may be...

circa 2 anni fa

Risolto


Component area
Find the area of the component below, all measurements are in mm <<https://image.ibb.co/hocruF/Component.png>>

circa 2 anni fa

Risolto


Euclidean inter-point distance matrix
The Euclidean distance between two points in a p-dimensional space is a really common thing to compute in the field of computati...

circa 2 anni fa

Risolto


Extract the Acrostic Message
An acrostic cipher is a way of embedding one message within another by taking the first (or last) word of each line. Given a str...

circa 2 anni fa

Risolto


Get a Fibonacci number's index.
*N.B.* For the purpose of this exercise, the first Fibonacci number is 1, and the second is 2; that is, |fib(1) = 1| and |fib(2)...

circa 2 anni fa

Risolto


Trickier Timing
You solution should return control to main program only when the current time ends in either a 5 or 0 (e.g. the current seconds ...

circa 2 anni fa

Risolto


Tricky timing
Write a function that takes between 0.5 seconds and 0.6 seconds to run.

circa 2 anni fa

Risolto


Back to basics 17 - white space
Covering some basic topics I haven't seen elsewhere on Cody. Remove the trailing white spaces from the input variable

circa 2 anni fa

Risolto


Back to basics 15 - classes
Covering some basic topics I haven't seen elsewhere on Cody. Return the class of the input variable.

circa 2 anni fa

Risolto


Assignment Problem
Given a matrix where row i corresponds to person i, and column j corresponds to task j and cell (i,j) corresponds to the time ta...

circa 2 anni fa

Risolto


Factorizing a number into a given number of factors
Given a positive integer, n, and another positive integer, b, return a matrix, M, of width b, with the following properties: (a)...

circa 2 anni fa

Risolto


Find maximum value of a curve
Two vectors shall be already defined: - Input vector x (e.g. x = 0:1:10) - Result vector y (e.g. y = sin(x)) Create a n...

circa 2 anni fa

Risolto


The last non-zero digit of a factorial
For given positive integer n, what is the last non-zero digit of n!? Example: factorial(11) = 39916800 Last non-zero d...

circa 2 anni fa

Carica altro