Answered

I can't find the mistake in the code

You can't use "abs" since the coefficients/x values can be negative.

I can't find the mistake in the code

You can't use "abs" since the coefficients/x values can be negative.

7 maanden ago | 0

Answered

Average of 2 sets of random numbers

Take a look at the binomial generator, it does what you want to.

Average of 2 sets of random numbers

Take a look at the binomial generator, it does what you want to.

7 maanden ago | 1

Answered

Add each row of a matrix consecutively to all the rows of other matrix where both have equal number of columns

You can avoid the loop by using repeated indexing: IndexesA = 1:size(A,1); IndexesA = sort( [IndexesA,IndexesA] ); % IndexesA=...

Add each row of a matrix consecutively to all the rows of other matrix where both have equal number of columns

You can avoid the loop by using repeated indexing: IndexesA = 1:size(A,1); IndexesA = sort( [IndexesA,IndexesA] ); % IndexesA=...

7 maanden ago | 0

| accepted

Answered

Finding 5th to 15th central moment

The std function has a bias correction which the kurtosis doesn't, if you remove it you get the same result: rng(31415) A = ...

Finding 5th to 15th central moment

The std function has a bias correction which the kurtosis doesn't, if you remove it you get the same result: rng(31415) A = ...

7 maanden ago | 2

| accepted

Answered

Extracting numeric values from symbolic variables

x==c The "==" operator is normally used as a logic comparison operation, not an assignment. In the case of using symbolic varia...

Extracting numeric values from symbolic variables

x==c The "==" operator is normally used as a logic comparison operation, not an assignment. In the case of using symbolic varia...

7 maanden ago | 0

| accepted

Answered

How to extract detail data from matlab Plot?

If you plot only 118 points you can't get more from the plot. The results are interpolated and probably what you want is a conti...

How to extract detail data from matlab Plot?

If you plot only 118 points you can't get more from the plot. The results are interpolated and probably what you want is a conti...

7 maanden ago | 0

| accepted

Answered

False Output from find-function?

max(A) is a vector, not a number: max(A) ans = Columns 1 through 15 1.0000 1.0000 1.0000 1.0000 1.0000...

False Output from find-function?

max(A) is a vector, not a number: max(A) ans = Columns 1 through 15 1.0000 1.0000 1.0000 1.0000 1.0000...

8 maanden ago | 1

| accepted

Answered

How can I write a Matlab code on Digital Signals Processing ?

This should work for you, the code is almost self explanatory: L = 1024; Periods = 4; M = 128; A = 1; figure,plot( squareWa...

How can I write a Matlab code on Digital Signals Processing ?

This should work for you, the code is almost self explanatory: L = 1024; Periods = 4; M = 128; A = 1; figure,plot( squareWa...

8 maanden ago | 0

| accepted

Answered

Curve to fit a loglog graph and its equation

There are some issues with your fit. First, log(0) is not defined, so what you expect to become from a fit that uses log(0)? If ...

Curve to fit a loglog graph and its equation

There are some issues with your fit. First, log(0) is not defined, so what you expect to become from a fit that uses log(0)? If ...

8 maanden ago | 0

Answered

How wide range do optimalisation algorithms cover?

All of them except fmincon are unconstrained optimization algorithms, which means they can have any possible value in the group ...

How wide range do optimalisation algorithms cover?

All of them except fmincon are unconstrained optimization algorithms, which means they can have any possible value in the group ...

8 maanden ago | 0

| accepted

Answered

In intlinprog how can I put condition for x = 1 or 0

You use a lower and upper bound of 0 and 1, respectively. Then if your number is an integer and should be between 0 and 1, the o...

In intlinprog how can I put condition for x = 1 or 0

You use a lower and upper bound of 0 and 1, respectively. Then if your number is an integer and should be between 0 and 1, the o...

8 maanden ago | 0

| accepted

Answered

How to display matlab plots in a GUI in python using api engine?

I don't think any python GUI has a canvas which can handle matlab plots directly. What you can do is to save your matlab plot as...

How to display matlab plots in a GUI in python using api engine?

I don't think any python GUI has a canvas which can handle matlab plots directly. What you can do is to save your matlab plot as...

8 maanden ago | 0

Answered

Matlab App designer 20190a

A push button cannot "stay pushed", as soon as you click it the callback is called and then the state is reset. If what you mean...

Matlab App designer 20190a

A push button cannot "stay pushed", as soon as you click it the callback is called and then the state is reset. If what you mean...

8 maanden ago | 0

| accepted

Answered

How to give conditions on transformations of variables in cvx?

As far as I know the Cvx library doesn't accepts fft/ifft. What you can do is to calculate the ifft by "brute force" in a way th...

How to give conditions on transformations of variables in cvx?

As far as I know the Cvx library doesn't accepts fft/ifft. What you can do is to calculate the ifft by "brute force" in a way th...

8 maanden ago | 0

Answered

retrieve phase information using 'pspectrum'

Why you need the phase? The pspectrum function calculates the power spectrum, which depends on the absolute square of the fft, s...

retrieve phase information using 'pspectrum'

Why you need the phase? The pspectrum function calculates the power spectrum, which depends on the absolute square of the fft, s...

9 maanden ago | 0

Answered

Finding the probability of a given x-value on a histogram

If your dataset has discrete values, you don't need to get the histogram, rather just count how many times the median appear and...

Finding the probability of a given x-value on a histogram

If your dataset has discrete values, you don't need to get the histogram, rather just count how many times the median appear and...

9 maanden ago | 0

| accepted

Answered

Make a standalone app

It can be both. With appdesigner you can either create an matlab app (that will run in any other matlab), a web application or a...

Make a standalone app

It can be both. With appdesigner you can either create an matlab app (that will run in any other matlab), a web application or a...

9 maanden ago | 1

| accepted

Answered

regression analysis of lagged days

Your first argument should be a matrix with all the variables you need for prediction. So, in your case, you need to form a matr...

regression analysis of lagged days

Your first argument should be a matrix with all the variables you need for prediction. So, in your case, you need to form a matr...

9 maanden ago | 0

| accepted

Answered

implementation of a matrix

This should do: rng(42) n = 3; x = rand(n,1); A = ones(n,n+1); Differences = x-x'; for idx=2:n+1 A(:,idx) = A(:,idx-1)...

implementation of a matrix

This should do: rng(42) n = 3; x = rand(n,1); A = ones(n,n+1); Differences = x-x'; for idx=2:n+1 A(:,idx) = A(:,idx-1)...

9 maanden ago | 0

| accepted

Answered

How to calculate steady state with fsolve with white noise in equations ?

That depends on how you define Steady state. If your derivatives are never actually zero, you will never have a fully perfect st...

How to calculate steady state with fsolve with white noise in equations ?

That depends on how you define Steady state. If your derivatives are never actually zero, you will never have a fully perfect st...

9 maanden ago | 1

Answered

Support Vector Machine: Linear or Non-linear

SVM is always linear in the parameters, but using non-linear kernels allows it to consider non-linear relations between the data...

Support Vector Machine: Linear or Non-linear

SVM is always linear in the parameters, but using non-linear kernels allows it to consider non-linear relations between the data...

9 maanden ago | 0

| accepted

Answered

Plot the STFT spectrogram

The function tutorials of matlab normally give code examples and results. For you to reproduce the result you just need to run t...

Plot the STFT spectrogram

The function tutorials of matlab normally give code examples and results. For you to reproduce the result you just need to run t...

9 maanden ago | 1

| accepted

Answered

Map triplets to a matrix

You can try the ismembertol function: [XX,YY] = meshgrid(0:0.1:1,0:0.1:1); Points = [XX(:),YY(:)]; PointsToMatch = [0,0; ...

Map triplets to a matrix

You can try the ismembertol function: [XX,YY] = meshgrid(0:0.1:1,0:0.1:1); Points = [XX(:),YY(:)]; PointsToMatch = [0,0; ...

9 maanden ago | 0

Answered

Finding the mean of a histogram

What do you mean by mean? The mean number of bins or the mean of the variables that the histogram represents? For the second you...

Finding the mean of a histogram

What do you mean by mean? The mean number of bins or the mean of the variables that the histogram represents? For the second you...

9 maanden ago | 0

Answered

How to compute the density of a 3D point cloud?

You can just directly apply the definition you gave considering that the density is N/Volume. The easiest is the second one, whi...

How to compute the density of a 3D point cloud?

You can just directly apply the definition you gave considering that the density is N/Volume. The easiest is the second one, whi...

9 maanden ago | 1

| accepted

Answered

Group array in a cell according to their size

A direct implementation could be done like this: A={[1 2 3 4] [4 5 6 9] [1 2 3] [7 8 9] [1 2] [3 4]}; sizes= []; for idx=1:...

Group array in a cell according to their size

A direct implementation could be done like this: A={[1 2 3 4] [4 5 6 9] [1 2 3] [7 8 9] [1 2] [3 4]}; sizes= []; for idx=1:...

10 maanden ago | 1

| accepted

Answered

How to fit one variable data into multiple ode equations

What you mean by y(1)? That you have data only for the first variable y1? Your equations seem to be coupled, so if you optimize ...

How to fit one variable data into multiple ode equations

What you mean by y(1)? That you have data only for the first variable y1? Your equations seem to be coupled, so if you optimize ...

10 maanden ago | 0

| accepted

Answered

How write these equation in Matlab for optimization

First you don't need the variable w, your problem is to maximize corr(Q,S), which is a unconstrained problem in x. Second, by yo...

How write these equation in Matlab for optimization

First you don't need the variable w, your problem is to maximize corr(Q,S), which is a unconstrained problem in x. Second, by yo...

10 maanden ago | 0

| accepted

Answered

Evaluate Function at different data points from vectors

Use meshgrid to generate all combinations and make your function accept vector entries. Ex: f = @(x,y,z)x.*y+z; % Insert your ...

Evaluate Function at different data points from vectors

Use meshgrid to generate all combinations and make your function accept vector entries. Ex: f = @(x,y,z)x.*y+z; % Insert your ...

10 maanden ago | 0

| accepted

Answered

Fit two peak model

You can estimate a continious function from your data using ksdensity and then fit two gaussians on it. My answer for the follow...

Fit two peak model

You can estimate a continious function from your data using ksdensity and then fit two gaussians on it. My answer for the follow...

10 maanden ago | 2

| accepted