A résolu


Laws of motion 2

plus d'un an il y a

A résolu


Laws of motion 3

plus d'un an il y a

A résolu


Laws of motion 4
Given the initial velocity 'u', final velocity 'v' and acceleration 'a', find the distance travelled.

plus d'un an il y a

A résolu


Laws of motion 5

plus d'un an il y a

A résolu


Laws of motion 6

plus d'un an il y a

A résolu


Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

presque 2 ans il y a

A résolu


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

presque 2 ans il y a

A résolu


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

presque 2 ans il y a

A résolu


Find max
Find the maximum value of a given vector or matrix.

presque 2 ans il y a

A résolu


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

presque 2 ans il y a

A résolu


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

presque 2 ans il y a

A résolu


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

presque 2 ans il y a

A résolu


Inner product of two vectors
Find the inner product of two vectors.

presque 2 ans il y a

A résolu


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

presque 2 ans il y a

A résolu


Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

presque 2 ans il y a

A résolu


Return area of square
Side of square=input=a Area=output=b

presque 2 ans il y a

A résolu


Global usage
This Challenge is to utilize Global variables. Global variables are risky as the subroutine may inadvertently and unwantingly...

presque 2 ans il y a

A résolu


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

presque 2 ans il y a

A résolu


Persistent Usage
This Challenge is to implement the Matlab Persistent variable capability. Given a sequence of Calls to a function return the cu...

presque 2 ans il y a

A résolu


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

presque 2 ans il y a

A résolu


Assign matrix rows/columns to separate variables
This is a slight variant of <http://www.mathworks.com/matlabcentral/cody/problems/2668-assign-matrix-elements-to-separate-variab...

presque 2 ans il y a

A répondu
Plot a Cube centered at the origin
Below is a solution to plot a cube using x,y,z coordinate using plot3d. Credit goes to Aggregate packing generator b = 50; %...

plus de 3 ans il y a | 0

A résolu


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

environ 4 ans il y a

A résolu


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

environ 4 ans il y a

A résolu


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

plus de 4 ans il y a

A résolu


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

plus de 4 ans il y a

A résolu


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

plus de 4 ans il y a

A résolu


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

plus de 4 ans il y a

A résolu


Remove all the consonants
Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

plus de 4 ans il y a

A résolu


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

plus de 4 ans il y a

Charger plus