Solved


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

13 years ago

Solved


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

13 years ago

Solved


Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

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

13 years ago

Solved


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

13 years ago

Solved


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

13 years ago

Solved


Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

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

13 years ago

Solved


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

13 years ago

Solved


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

13 years ago

Solved


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

13 years ago

Solved


Add two numbers
Given a and b, return the sum a+b in c.

13 years ago

Solved


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

13 years ago

Solved


Is my wife right?
Regardless of input, output the string 'yes'.

13 years ago

Answered
How do I concentrate my interpolation coloring around specific data ranges?
The simplest solution would be to change the mapping of data values to the colormap using <http://www.mathworks.com/help/matlab/...

13 years ago | 0

| accepted

Answered
I want use Simpson numerical integration method
If you want your integral to be a function of all the parameters, you could define the following: function y = fintegral(k,...

13 years ago | 0

| accepted

Answered
I want to initialize class variables through array type class object using a function
The main problem is that in the command Initialize( n,i,noOfNodes); the output isn't assigned to |n|. You need n = ...

13 years ago | 0

Answered
How to integrate an array properly in matlab
Assuming you are trying to integrate over |theta|, a good approach is to create a function for your integrand like this: fu...

13 years ago | 0

| accepted

Answered
value classes - do you use them? I must be doing something wrong...
I have no idea what your method |double| does or what your class constructor does with the input, so I'll create a trivial examp...

13 years ago | 0

Answered
Subplot titiles in one command
You could just have the title command inside the inner loop. Suppose you have some sort of function |yourTitleHere(i,j)| for cre...

13 years ago | 1

Answered
Interpolating / Fitting to 3D Data
Have a look at <http://www.mathworks.com/help/matlab/ref/triscatteredinterp.html TriScatteredInterp>.

13 years ago | 0

Answered
non linear minimization
The simplest approach would be to invert the equation to get Q = ((T-T0).*k +(H.*z.^2))./z; This will give you three est...

14 years ago | 0

Answered
t Copula Fit
That's just a consequence of the small sample size, and consistent with the 95% confidence estimate ( |nuci| ) you get for |nuha...

14 years ago | 0

Answered
fortran 128 bit precision
The default numerical type is |double|, which has 53 bit precision (the other 11 bits being for exponents and sign). If you have...

14 years ago | 0

Answered
Troubleshooting tips
I tried it, and it doesn't complain if you provide values for all the constants and make sure that |V| has two elements, for exa...

14 years ago | 0

| accepted

Answered
Overriding "get"-able properties.
The problem occurs because you have to redefine the property |foo| in addition to the method |get.foo|. In <http://www.mathworks...

14 years ago | 0

Answered
Writing a Matlab function for the first time
I think what you are trying to do is convert a row vector into a matrix with |total_sets| number of rows. You can do this with t...

14 years ago | 0

| accepted

Answered
How to update struct array fields with mutiple values
What timing! It happens that the <http://blogs.mathworks.com/pick/2012/03/02/when-deal-doesnt-work-disperse-2/?utm_source=feedbu...

14 years ago | 0

Answered
calculating average
Here is some code that might do the job. I am assuming that your image is truecolor, so the data have dimensions |M x N x 3| for...

14 years ago | 0

| accepted

Answered
compass plot offsetting the origin
You could make a couple of subplots: subplot 211 compass(...) subplot 212 compass(...) *EDIT*: However, if you really...

14 years ago | 0

Load more