Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

7ヶ月 前

Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

7ヶ月 前

Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

7ヶ月 前

Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

7ヶ月 前

Indexing how many times is an element repeated in a matrix in another array
The following piece of code solve your problem: arr = unique(A); for i=1:length(arr) n = arr(i); B(A==n) = 1:length(...

7ヶ月 前 | 1

| 採用済み

Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

7ヶ月 前

Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...

7ヶ月 前

Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

7ヶ月 前

Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

7ヶ月 前

Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

7ヶ月 前

Read a column of numbers and interpolate missing data
Given an input cell array of strings s, pick out the second column and turn it into a row vector of data. Missing data will be i...

7ヶ月 前

Loop for repeating a process multiple times
You need to use the ./ operator to perform division of arrays. Try this E = 100; I = 1:100; C = 1; Loss ...

7ヶ月 前 | 1

| 採用済み

Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

7ヶ月 前

Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

7ヶ月 前

Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

7ヶ月 前

Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

7ヶ月 前

Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

7ヶ月 前

Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

7ヶ月 前

Side of a rhombus
If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

7ヶ月 前

Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

7ヶ月 前

Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

7ヶ月 前

Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

7ヶ月 前

Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

7ヶ月 前

i cannot find the minimum values for matrix.
Alternative method to find the minium value for each column: min(T,[],1)

7ヶ月 前 | 0

| 採用済み

[U,V]=eig(A) , AU won't equal UV
It is not a bug. It depends of the floating point numbers. If you type the following, you will observe that the floating point...

7ヶ月 前 | 1

Determine if input is a Narcissistic number
<http://en.wikipedia.org/wiki/Narcissistic_number Narcissistic number> is a number that is the sum of its own digits each raised...

7ヶ月 前

sz means in image segmentation
Let's say you have size = [300 400]. So, img is a matrix of zeros with this size. than you might show. Try the following code: ...

7ヶ月 前 | 1

Unable to perform assignment because the left and right sides have a different number of elements - Gauss-Seidel Method to solve for inverse matrix
For this case, it seems vec has 5x1 size. So you should you sum instead of trace. function [abserr] =errnorm(vec) vec = a...

7ヶ月 前 | 1

| 採用済み

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side - Jacobi method inverse calculation
Function errnorm(vec) has inconsistent size. Try the following modifications: function [abserr] =errnorm(vec) vec = abs(ve...

7ヶ月 前 | 1

| 採用済み

Undefined function 'abs' for input arguments of type 'cell'.
It is saying A is a cell type. In order to check it, run the following code: class(A) If this is the case, the following shoul...

7ヶ月 前 | 1

| 採用済み