Answered

Particle size calculation from given image

The size for each particle is a task which is extremely hard to automatize, you will always get some error due to different ligh...

Particle size calculation from given image

The size for each particle is a task which is extremely hard to automatize, you will always get some error due to different ligh...

2 months ago | 0

Answered

Mean absolute value for ecg signal

Your code is okay with exception of the length. If you have a sampling rate of 250 Hz (or, in another way of expression, values ...

Mean absolute value for ecg signal

Your code is okay with exception of the length. If you have a sampling rate of 250 Hz (or, in another way of expression, values ...

2 months ago | 0

Answered

How to work with Matrices that have a great difference in element size (e.g. 1 to 10e+15)?

I don't believe you're facing problems due to the difference of magnitudes, but rather because your problem may be very ill-cond...

How to work with Matrices that have a great difference in element size (e.g. 1 to 10e+15)?

I don't believe you're facing problems due to the difference of magnitudes, but rather because your problem may be very ill-cond...

2 months ago | 0

| accepted

Answered

Nonlinear multiobjective optimization - Gamultiobj - Options

If you write your optimization problem like this: x = gamultiobj(fun,nvars) You're basically telling the optimizer that you ha...

Nonlinear multiobjective optimization - Gamultiobj - Options

If you write your optimization problem like this: x = gamultiobj(fun,nvars) You're basically telling the optimizer that you ha...

2 months ago | 0

Answered

How to generate lines between a fixed point and evenly spaced points on a line

If I understood your question right you mean something like this? clc; xlim([0, 100]); ylim([0, 100]); hold on Ax=0; Ay...

How to generate lines between a fixed point and evenly spaced points on a line

If I understood your question right you mean something like this? clc; xlim([0, 100]); ylim([0, 100]); hold on Ax=0; Ay...

2 months ago | 1

| accepted

Answered

PLOTTING A SINE WAVE USING TRIGNOMETRIC FOURIER SERIES

You have an analytical waveform, so you can generate it for 4 cycles without using any fourier function. Then, if you use the ff...

PLOTTING A SINE WAVE USING TRIGNOMETRIC FOURIER SERIES

You have an analytical waveform, so you can generate it for 4 cycles without using any fourier function. Then, if you use the ff...

2 months ago | 0

Answered

how to imput a matrix end outpur four arguments

The main function creation in matlab has the following form: function output = FuncName(input) output = f(input) end Input...

how to imput a matrix end outpur four arguments

The main function creation in matlab has the following form: function output = FuncName(input) output = f(input) end Input...

2 months ago | 0

Answered

Optimization of 4 variables by minimizing RMSE error as an objective function using fminsearch

Some points: Your rmse function is not returning any value You need to pass a function to the optimization function that takes...

Optimization of 4 variables by minimizing RMSE error as an objective function using fminsearch

Some points: Your rmse function is not returning any value You need to pass a function to the optimization function that takes...

2 months ago | 0

| accepted

Answered

I'm getting an error in obtaining the optimal solution for a nonlinear equation

You have an error in your wolf loop. It should be like this: while ( ( ( fh > f + c*alpha0*gradx'*p ) || ( abs(gradk)'*p > cu*a...

I'm getting an error in obtaining the optimal solution for a nonlinear equation

You have an error in your wolf loop. It should be like this: while ( ( ( fh > f + c*alpha0*gradx'*p ) || ( abs(gradk)'*p > cu*a...

2 months ago | 0

| accepted

Answered

odeEueler Explicit Eurlers method

You had many syntax errors on your code. Here is a version with them fixed and it should work. Although a negative weighting is ...

odeEueler Explicit Eurlers method

You had many syntax errors on your code. Here is a version with them fixed and it should work. Although a negative weighting is ...

2 months ago | 0

| accepted

Answered

Filter time-variant data and reduce its length

Take a look at medfilt1 and/or movmean. They sould help you reduce the fluctuations. To reduce the data length you just index th...

Filter time-variant data and reduce its length

Take a look at medfilt1 and/or movmean. They sould help you reduce the fluctuations. To reduce the data length you just index th...

2 months ago | 0

Answered

How to use function like `min` in symfun?(I got an error)

You can't use min or max in symbolic variables in matlab. A work around can be this one: syms x1 x2 real; xlt = symfun(1/2*(x1...

How to use function like `min` in symfun?(I got an error)

You can't use min or max in symbolic variables in matlab. A work around can be this one: syms x1 x2 real; xlt = symfun(1/2*(x1...

2 months ago | 1

| accepted

Answered

Minimum of a function

You had some typos in your constrain function and also you don't need to create a function file for your function since you alre...

Minimum of a function

You had some typos in your constrain function and also you don't need to create a function file for your function since you alre...

2 months ago | 1

| accepted

Answered

How do I fix the array error?

Look this part as example: for t = ProjectedTime HatchVec = Hatchling - (Hatchling .* 0.675) - (Hatchling .* 0.325) + (Bre...

How do I fix the array error?

Look this part as example: for t = ProjectedTime HatchVec = Hatchling - (Hatchling .* 0.675) - (Hatchling .* 0.325) + (Bre...

3 months ago | 0

| accepted

Answered

how to fit a Nonlinear model with multiple input and single output by using dataset in matlab

Without your data nor any code is difficult to specifically help you. Still, a general thing you may do, if you already have the...

how to fit a Nonlinear model with multiple input and single output by using dataset in matlab

Without your data nor any code is difficult to specifically help you. Still, a general thing you may do, if you already have the...

3 months ago | 0

Answered

Is there any method to plot two dimensional view of a function which depends on multi variables?

What exactly you expect to get with this? Your function dependes on three variables, so if you vary only x, the result will depe...

Is there any method to plot two dimensional view of a function which depends on multi variables?

What exactly you expect to get with this? Your function dependes on three variables, so if you vary only x, the result will depe...

3 months ago | 1

Answered

Retrive variable out of a parfor loop

You have an error in your mont_carlo inputs, it should be [x,neigh,E,M]= monte_carlo ( N, T, iter,init ) or you should delete ...

Retrive variable out of a parfor loop

You have an error in your mont_carlo inputs, it should be [x,neigh,E,M]= monte_carlo ( N, T, iter,init ) or you should delete ...

3 months ago | 0

| accepted

Answered

Predict function in KNN

Your KNN is not a single model to make predictions but rather a RegressionPartitionedModel. Which means it has all the statistic...

Predict function in KNN

Your KNN is not a single model to make predictions but rather a RegressionPartitionedModel. Which means it has all the statistic...

3 months ago | 0

| accepted

Answered

Find params that minimize function

You can define it as an annonymous function and then call fminsearch to solve it: e = 5; xi = [1,2,3,4]; yi = [3,4,5,6]; si...

Find params that minimize function

You can define it as an annonymous function and then call fminsearch to solve it: e = 5; xi = [1,2,3,4]; yi = [3,4,5,6]; si...

3 months ago | 0

| accepted

Answered

How to implement mathematical functions

Considering that nu is a function of x,y,z and you described it as a 3-dimensional matrix in your code you could implement then ...

How to implement mathematical functions

Considering that nu is a function of x,y,z and you described it as a 3-dimensional matrix in your code you could implement then ...

3 months ago | 1

Answered

Swap all the values in a vector

Yes, randperm: rng(31415) x=[ 1 2 3 4 5 6 7 8]; p = randperm(length(x)); xnew = x(p) xnew = 7 8 1 2 ...

Swap all the values in a vector

Yes, randperm: rng(31415) x=[ 1 2 3 4 5 6 7 8]; p = randperm(length(x)); xnew = x(p) xnew = 7 8 1 2 ...

3 months ago | 0

Answered

Multidimensional surface fitting to n independent variables.

You first have to define which kind of function you would like to build. lsqcurvefit can surely be used, but you first have to d...

Multidimensional surface fitting to n independent variables.

You first have to define which kind of function you would like to build. lsqcurvefit can surely be used, but you first have to d...

3 months ago | 0

Answered

how to intergrate my acceleration vs time curve to velocity vs time curve with simpson's rule, instead of using cumtrapz?

You need to implement the simpson's rule on your own. A naive implementation would be something like that f = @(t)t.^2; N = 1...

how to intergrate my acceleration vs time curve to velocity vs time curve with simpson's rule, instead of using cumtrapz?

You need to implement the simpson's rule on your own. A naive implementation would be something like that f = @(t)t.^2; N = 1...

3 months ago | 0

Answered

The first letter of the string value was not written

I would advise you to perform the last string into a loop, so you're sure they are going to be displayed right: n=input('Please...

The first letter of the string value was not written

I would advise you to perform the last string into a loop, so you're sure they are going to be displayed right: n=input('Please...

3 months ago | 0

Answered

Finding index of a value in the matrix

This is probably the shortest you can get range=find( abs(A(:,1) - targetPhase) < 2 ); % targetPhase is the required phase [~...

Finding index of a value in the matrix

This is probably the shortest you can get range=find( abs(A(:,1) - targetPhase) < 2 ); % targetPhase is the required phase [~...

3 months ago | 0

| accepted

Answered

How can i plot this graph?

Making y=... substitute the whole array. Try something like this: x=0:0.5:5; y = zeros(size(x)); for idx = 1:length(x) i...

How can i plot this graph?

Making y=... substitute the whole array. Try something like this: x=0:0.5:5; y = zeros(size(x)); for idx = 1:length(x) i...

3 months ago | 0

Answered

Find the average difference of two adjacent frames on a set of images

Without further details it is difficult to know how exactly you would like to calculate it. A naive implementation that does exa...

Find the average difference of two adjacent frames on a set of images

Without further details it is difficult to know how exactly you would like to calculate it. A naive implementation that does exa...

3 months ago | 0

| accepted

Answered

Minimising the variance of a portfolio using weights of assets and covariance matrix

If you have the additional constrain that the weights must sum to 1 than you must also increase the lower bound. Otherwise the o...

Minimising the variance of a portfolio using weights of assets and covariance matrix

If you have the additional constrain that the weights must sum to 1 than you must also increase the lower bound. Otherwise the o...

3 months ago | 1

| accepted

Answered

fitgpr gaussian regression parameters

A Gaussian Process Regression is a non-parametric model, which means it heavily depends of the training data you use. This means...

fitgpr gaussian regression parameters

A Gaussian Process Regression is a non-parametric model, which means it heavily depends of the training data you use. This means...

3 months ago | 0

| accepted

Answered

How can I use uigetfile when I click on an edit text in a GUI?

You can't. Every GUI component has it's own callbacks, for the edit text element you have callbacks such as key press/release an...

How can I use uigetfile when I click on an edit text in a GUI?

You can't. Every GUI component has it's own callbacks, for the edit text element you have callbacks such as key press/release an...

3 months ago | 0