Solved

Find the position of first minimum value in an integer array with numbers

If x = [2 6 4 9 10 3 1 5 1] the the output should be 7, because the first minimum value (1) lies at the 7th position.

6 years ago

Solved

Equidistant numbers containing certain value in an interval

Given a lower and upper bound of an interval, distance between numbers, and one particular number from that interval, create an ...

6 years ago

Solved

Add damping to a mass spring system

Model an ideal mass-spring-damper system shown below where the spring is initially stretched. <<http://blogs.mathworks.com/im...

6 years ago

Solved

construct matrix with identical rows

Input a row vector such as x=1:10. Now we need to construct a matrix with L rows,of which every row vector is a copy of x. E...

6 years ago

Solved

Infernal Recursion

Consider the recursion relation: x_n = (x_(n-1)*x_(n-2))^k Given x_1, x_2, and k, x_n can be found by this definition. Wr...

6 years ago

Solved

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

6 years ago

Solved

Find nth maximum

Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

6 years ago

Solved

Matlab Basics II - Intervals

Write a function that takes an interval from a to b, and divides it into 5 parts example: a = 1, b = 2 output = 1 1.25 ...

6 years ago

Solved

Create a matrix X, where each column is a shifted copy of the vector v

Example : in->v = (1:5)'; 1 2 3 4 5 out-> [1 5 4 3 2;2 1 5 4 3;3 2 1 5 4;4 3 2 1 5;5 4 3 ...

6 years ago

Solved

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: * ...

6 years ago

Solved

Flip the vector from right to left

Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

6 years ago

Solved

Set some matrix elements to zero

First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix: 1 2 3 ...

6 years ago

Solved

Matlab Basics - Pick out parts of a vector

Consider x a vector of length >= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, a...

6 years ago

Solved

Matlab Basics II - Free Fall

An object freely falling from rest under gravity covers a distance x given by: x = 1/2 gt^2 write a function that calculat...

6 years ago

Solved

Proper Factors

Generate the proper factors of input integer _x_ and return them in ascending order. For more information on proper factors, ref...

6 years ago

Solved

wait for me

wait exactly x seconds please, need not be more than 2 seconds but must be accurate within say 50 milliseconds, your function mu...

6 years ago

Solved

Multiples of a Number in a Given Range

Given an integer factor _f_ and a range defined by _xlow_ and _xhigh_ inclusive, return a vector of the multiples of _f_ that fa...

6 years ago

Solved

If-then-else

Complete the function below such that if the value of x is in the range 10 to 14, inclusive, the value 18 is assigned to y. Oth...

6 years ago

Solved

Create One Large Eye of size N x N Quickly?

*<http://en.wikipedia.org/wiki/Aye_(yes) Aye !!!>*

6 years ago

Solved

Comparing floating point values

* Assign matchFound with true if firstSample and secondSample are less than thresholdValue.

6 years ago

Solved

Generate a Parasitic Number

This problem is the next step up from <http://www.mathworks.com/matlabcentral/cody/problems/156-parasitic-numbers Problem 156>. ...

6 years ago

Solved

Generalised Hamming Number

Inspired by Project Euler n°204 and Problem 1308 by James A generalised Hamming number of type n, has no prime factor larger ...

6 years ago

Solved

nth Rational Number

Return the nth rational number. This is the inverse to Problem <http://www.mathworks.com/matlabcentral/cody/problems/1471 1...

6 years ago

Solved

Polygonal numbers

The task of <http://www.mathworks.co.uk/matlabcentral/cody/problems/5 Problem 5> is to calculate triangular numbers. By playing ...

6 years ago

Solved

Find vampire numbers

A <http://en.wikipedia.org/wiki/Vampire_number vampire number> is a number v that is the product of two numbers x and y such th...

6 years ago

Solved

Convert hex color specification to MATLAB RGB

Here's something that comes up all the time if you deal with web pages. Given a <http://www.w3schools.com/html/html_colors.as...

6 years ago

Solved

Polite numbers. Politeness.

A polite number is an integer that sums of two or more consecutive positive integers. Politeness of a positive integer is a num...

6 years ago

Solved

Bell Number calculator

Calculate a vector of Bell numbers for sets up to length n. Bell numbers are the maximum number of partitions of a set. See the ...

6 years ago

Solved

Matlab Basics - Rounding III

Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000

6 years ago