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

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

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

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

11 years ago

Solved

Determine if input is odd

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

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

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

11 years ago

Solved

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

11 years ago

Answered

Using uiimport and subsequent coded commands

Hi Jason, In order for your code to wait until uiimport has finished, make sure you request a return value from uiimport. ...

Using uiimport and subsequent coded commands

Hi Jason, In order for your code to wait until uiimport has finished, make sure you request a return value from uiimport. ...

11 years ago | 0

| accepted

Answered

Remove ObsNames from MatLab dataset

The property ObsNames may be empty. Otherwise, it should have as many strings as observations. To remove these ObsNames from a d...

Remove ObsNames from MatLab dataset

The property ObsNames may be empty. Otherwise, it should have as many strings as observations. To remove these ObsNames from a d...

11 years ago | 0

| accepted

Answered

How to measure running time of a code using MATLAB

Take a look at the <http://www.mathworks.es/help/techdoc/ref/tic.html tic> and <http://www.mathworks.es/help/techdoc/ref/toc.htm...

How to measure running time of a code using MATLAB

Take a look at the <http://www.mathworks.es/help/techdoc/ref/tic.html tic> and <http://www.mathworks.es/help/techdoc/ref/toc.htm...

11 years ago | 5

| accepted

Answered

Select a random number from a set

There are a few ways to do it. For example, using randi to select in which position is the card that you will extract. pos ...

Select a random number from a set

There are a few ways to do it. For example, using randi to select in which position is the card that you will extract. pos ...

11 years ago | 10

Answered

Neural Network code

Your code is basically creating a network with only one layer of neurons. With newfit this means that the network is trying to f...

Neural Network code

Your code is basically creating a network with only one layer of neurons. With newfit this means that the network is trying to f...

11 years ago | 0

| accepted

Answered

how to find distance between two points?

You can use the <http://www.mathworks.es/help/toolbox/stats/pdist.html pdist> function in the Statistics Toolbox: e.g: distance...

how to find distance between two points?

You can use the <http://www.mathworks.es/help/toolbox/stats/pdist.html pdist> function in the Statistics Toolbox: e.g: distance...

11 years ago | 27

| accepted

Answered

how to separate out the lung sounds from heart sounds ?

You can use adaptfilt in the DSP toolbox for adaptive noise canceling. A "similar" <http://www.mathworks.com/products/dsp-system...

how to separate out the lung sounds from heart sounds ?

You can use adaptfilt in the DSP toolbox for adaptive noise canceling. A "similar" <http://www.mathworks.com/products/dsp-system...

11 years ago | 0

Answered

checking of existing an string in a cell arrays

if ~any(strcmp(CELL,'a')) % Do Something else % Do Something else end

checking of existing an string in a cell arrays

if ~any(strcmp(CELL,'a')) % Do Something else % Do Something else end

11 years ago | 34

| accepted

Answered

create vector of repeating elements (sort of)

One of many ways: >> w = 3; n = 8; >> v = repmat(1:n,w,1); >> v = v(1:end)

create vector of repeating elements (sort of)

One of many ways: >> w = 3; n = 8; >> v = repmat(1:n,w,1); >> v = v(1:end)

11 years ago | 0

Answered

Angle between two vectors in 3d

You can use the subspace function to find the angle between two subspaces: >> subspace([1;0;0],[0;1;0]) ans = 1...

Angle between two vectors in 3d

You can use the subspace function to find the angle between two subspaces: >> subspace([1;0;0],[0;1;0]) ans = 1...

11 years ago | 3

Answered

Combining vectors of day, month and year into a single date vector

dates = datenum([year,month,day]); Then you can plot your data vs. dates. Finally, use |datetick| to change the format o...

Combining vectors of day, month and year into a single date vector

dates = datenum([year,month,day]); Then you can plot your data vs. dates. Finally, use |datetick| to change the format o...

11 years ago | 3

| accepted

Answered

Error Message when using configured ANN (mismatch number of inputs)

The functions for creating networks in the toolbox will assume that if your input matrix is |n x m| it will represent |m| sample...

Error Message when using configured ANN (mismatch number of inputs)

The functions for creating networks in the toolbox will assume that if your input matrix is |n x m| it will represent |m| sample...

11 years ago | 0

| accepted

Answered

How to define the abstract symbolic of 'f=f(x,y,z)' at Matlab-Smbolic.

You can do the following: >> syms x y z; >> f = sym('f(x,y,z)'); >> g = x * f + y * f^2 + z; >> jacobian(g, [x,y,z]) ans ...

How to define the abstract symbolic of 'f=f(x,y,z)' at Matlab-Smbolic.

You can do the following: >> syms x y z; >> f = sym('f(x,y,z)'); >> g = x * f + y * f^2 + z; >> jacobian(g, [x,y,z]) ans ...

11 years ago | 1

Answered

find max of a vector between two indice

>> C = arrayfun(@(x) max(B(A(x):A(x+1))),1:length(A)-1) C = 2 9

find max of a vector between two indice

>> C = arrayfun(@(x) max(B(A(x):A(x+1))),1:length(A)-1) C = 2 9

11 years ago | 0

| accepted

Answered

transposing the contents of the cell

Let |C| be your cell. You can do the following: C = cellfun(@transpose,C,'un',0);

transposing the contents of the cell

Let |C| be your cell. You can do the following: C = cellfun(@transpose,C,'un',0);

11 years ago | 2

| accepted

Answered

spline? interp?

Do you have the curve fitting toolbox? If so, you can try using the functions |cscvn| for interpolating the spline and |fnplt|...

spline? interp?

Do you have the curve fitting toolbox? If so, you can try using the functions |cscvn| for interpolating the spline and |fnplt|...

11 years ago | 0

Answered

Kohonen (example from help does not work)

Which release are you using? There is a known bug in R2010b and R2011a regarding newc and competlayer. <http://www.mathworks.co...

Kohonen (example from help does not work)

Which release are you using? There is a known bug in R2010b and R2011a regarding newc and competlayer. <http://www.mathworks.co...

11 years ago | 0

Answered

Neural Network - Multi Step Ahead Prediction

Hi Jack, When using |narxnet|, the network performs only a one-step ahead prediction after it has been trained. Therefore, yo...

Neural Network - Multi Step Ahead Prediction

Hi Jack, When using |narxnet|, the network performs only a one-step ahead prediction after it has been trained. Therefore, yo...

11 years ago | 20

| accepted

Answered

Converting a complex number to polar form and finding it's magnitude

r = abs(z); theta = atan2(imag(z),real(z)); Also... r = abs(z); theta = angle(z);

Converting a complex number to polar form and finding it's magnitude

r = abs(z); theta = atan2(imag(z),real(z)); Also... r = abs(z); theta = angle(z);

11 years ago | 1

| accepted

Answered

complex numbers in Symbolic Toolbox

*[Updated]* Define the symbolic variables as real and use the function |simplify| when needed: >> syms a b c d real; >> F=a...

complex numbers in Symbolic Toolbox

*[Updated]* Define the symbolic variables as real and use the function |simplify| when needed: >> syms a b c d real; >> F=a...

11 years ago | 2

| accepted