Solved

Replace all odd numbers with NaN

Replace all odd numbers in the vector or matrix with NaN. For example, if x = [1 3 4 5 8 11]; then return y = [NaN Na...

2 hours ago

Solved

String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values

<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

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

2 hours ago

Solved

Create a cell array out of a struct

Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

2 hours ago

Solved

Natural numbers in string form

Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

3 hours ago

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

1 day ago

Solved

Solve system of equation!

Given provided system of equation, and find x and y. System of equation can be expressed as each term's coefficient. For exam...

1 day ago

Solved

Removing vibration!

There are [y] that vary with [x] but y including small useless vibration. x=1:10 y=[1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.3...

1 day ago

Solved

Cody problems in French : Trouvez la logique Pt.2

Trouvez la logique entre x et y, aidez-vous de la test suite. Bon courage. P.S: L'utilisation de "^" est de nouveau fortement...

1 day ago

Solved

Analyze observation data

Suppose you have the following data (A,B,C) in three-column format. A B C -------------------------- t=1 ...

1 day ago

Solved

Scalar Matrix Manipulation

Assume, input x is a scalar matrix such as, x = 2 0 0 0 2 0 0 0 2 th...

1 day ago

Solved

Find the complement of a number in binary

Input x is a decimal number and output y is the complement of binary representation of x. For example, x = 10 has the binary ...

1 day ago

Answered

Use loops to create a 3 x 5 matrix in which the value of each element is the difference between the indices divided by the sum of its indices (the row num ber and column number of the element). For example, the value of the element (2,5) is (2 – 5)/

[a,b]=ind2sub([3 5],1:15); m = reshape((a-b)./(b+a),[3],[5]);

Use loops to create a 3 x 5 matrix in which the value of each element is the difference between the indices divided by the sum of its indices (the row num ber and column number of the element). For example, the value of the element (2,5) is (2 – 5)/

[a,b]=ind2sub([3 5],1:15); m = reshape((a-b)./(b+a),[3],[5]);

1 day ago | 0

Solved

Derivative function

Given a function handle f, generate a function that evaluates the derivative of f Examples: f = @sin; df = De...

1 day ago