Solved

Fix the last element of a cell array

Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

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

8 mesi ago

Solved

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

8 mesi ago

Solved

Convert a Cell Array into an Array

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

8 mesi ago

Solved

Integer Sequence - II : New Fibonacci

Crack the following Integer Sequence. (Hints : It has been obtained from original Fibonacci Sequence and all the terms are also ...

8 mesi ago

Solved

Find the next Fibonacci number

In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

8 mesi ago

Solved

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

8 mesi ago

Solved

Return fibonacci sequence do not use loop and condition

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

8 mesi ago

Solved

Find the maximum number of decimal places in a set of numbers

Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not coun...

8 mesi ago

Solved

Make roundn function

Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...

8 mesi ago

Solved

Rounding off numbers to n decimals

Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

8 mesi 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

8 mesi ago

Solved

Matlab Basics - Rounding II

Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346

8 mesi ago

Solved

Check that number is whole number

Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. http://en.wikipedia.org/wiki/Whole_numb...

8 mesi ago

Solved

MATLAB Basic: rounding IV

Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

8 mesi ago

Solved

MATLAB Basic: rounding III

Do rounding towards minus infinity. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 8

8 mesi ago

Solved

MATLAB Basic: rounding

Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

8 mesi ago

Solved

MATLAB Basic: rounding II

Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

8 mesi ago

Solved

Distance walked 1D

Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

8 mesi ago

Solved

radius of a spherical planet

You just measured its surface area, that is the input.

8 mesi ago

Solved

Piecewise linear interpolation

Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

8 mesi ago

Solved

Reindex a vector

You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

8 mesi ago

Solved

"Low : High - Low : High - Turn around " -- Create a subindices vector

Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

8 mesi ago

Solved

Matrix indexing with two vectors of indices

Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

8 mesi ago

Solved

middleAsColumn: Return all but first and last element as a column vector

Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

8 mesi ago

Solved

Construct an index vector from two input vectors in vectorized fashion

Create an index vector defined by two input vectors, one defining the beginnings of one or more index ranges, and the other defi...

8 mesi ago

Solved

Get the elements of diagonal and antidiagonal for any m-by-n matrix

In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

8 mesi ago

Solved

How to find the position of an element in a vector without using the find function

Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

8 mesi ago

Solved

Return elements unique to either input

Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

8 mesi ago