Solved

Laws of motion 4

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

3 meses ago

Solved

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

4 meses ago

Solved

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

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

4 meses ago

Solved

Get the length of a given vector

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

4 meses ago

Solved

Whether the input is vector?

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

4 meses ago

Solved

Vector creation

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

4 meses ago

Solved

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

4 meses ago

Solved

Global usage

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

4 meses ago

Solved

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

4 meses ago

Solved

Persistent Usage

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

4 meses ago

Solved

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

4 meses ago

Answered

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

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

alrededor de 2 años ago | 0

Solved

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

más de 2 años ago

Solved

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

más de 2 años ago

Solved

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

casi 3 años ago

Solved

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

casi 3 años ago

Solved

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

casi 3 años ago

Solved

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

casi 3 años ago

Solved

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

casi 3 años ago

Solved

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

casi 3 años ago