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

2 days ago | 1

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

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

2 days ago | 0

Answered

Write cell array to excel format with xlswrite

You need to check the syntax of xlswrite, then you see that you're calling it with wrong arguments. You have to transform your a...

Write cell array to excel format with xlswrite

You need to check the syntax of xlswrite, then you see that you're calling it with wrong arguments. You have to transform your a...

2 days ago | 0

| accepted

Answered

curve fitting and image segmentation

In this case, for each column you have there's a different line point, so you have to check for each one individually and do the...

curve fitting and image segmentation

In this case, for each column you have there's a different line point, so you have to check for each one individually and do the...

9 days ago | 0

| accepted

Answered

How to modify the values of axis (image explaining better)

Just check the first example of mathworks here. You can solve your problem by using xticks (and eventually xtickslabel if you wa...

How to modify the values of axis (image explaining better)

Just check the first example of mathworks here. You can solve your problem by using xticks (and eventually xtickslabel if you wa...

9 days ago | 1

| accepted

Answered

running a file from inside a parfor loop

The main problem is that parfor can not tell from which workspace the variables should be used since you have many. You can solv...

running a file from inside a parfor loop

The main problem is that parfor can not tell from which workspace the variables should be used since you have many. You can solv...

9 days ago | 0

| accepted

Answered

please help write matlab code that plots the following function

You have a complex function, so you should define what exactly you want to plot of this function. Some alternatives are the foll...

please help write matlab code that plots the following function

You have a complex function, so you should define what exactly you want to plot of this function. Some alternatives are the foll...

16 days ago | 0

| accepted

Answered

Sum only consecutive positive numbers and place the sum in a new vector in specific positions

Try this: lo = P1 > 0; Dfference = diff([lo(:);0]); Ends = find(Dfference==-1); % -1 are the positions where a sequence en...

Sum only consecutive positive numbers and place the sum in a new vector in specific positions

Try this: lo = P1 > 0; Dfference = diff([lo(:);0]); Ends = find(Dfference==-1); % -1 are the positions where a sequence en...

16 days ago | 0

Answered

Multiplying by the number of the day of each month in a cell arrays

Days will not calculate the days in a specific month, you have to do it manually, so you have to check which years are leap year...

Multiplying by the number of the day of each month in a cell arrays

Days will not calculate the days in a specific month, you have to do it manually, so you have to check which years are leap year...

16 days ago | 1

Answered

How could add noise to a music file in a way that after a certain amount of time the music file become noise free?

You were almost there. The array you have to shorten is the noise one, while, at the same time, adding it only at the initial va...

How could add noise to a music file in a way that after a certain amount of time the music file become noise free?

You were almost there. The array you have to shorten is the noise one, while, at the same time, adding it only at the initial va...

23 days ago | 0

Answered

How do I pull Time values from the found indicies of Force?

indBefore10 contains only the index, not the force itself, you have to give then back to the force array to actually get the res...

How do I pull Time values from the found indicies of Force?

indBefore10 contains only the index, not the force itself, you have to give then back to the force array to actually get the res...

23 days ago | 0

| accepted

Answered

unknown code- understand it up to the for loop but am lost from there. Can anyone lend a hand? thanks.

What the code was supposed to be? it looks like the variable out is suppose to be the numerical derivative of b with respect to ...

unknown code- understand it up to the for loop but am lost from there. Can anyone lend a hand? thanks.

What the code was supposed to be? it looks like the variable out is suppose to be the numerical derivative of b with respect to ...

23 days ago | 1

| accepted

Answered

How to use the log-binning of the Fourier energy spectrum?

I'm not entirely sure what you mean by log-binning, but a regular interpretation for it is just to resample the fft in log-space...

How to use the log-binning of the Fourier energy spectrum?

I'm not entirely sure what you mean by log-binning, but a regular interpretation for it is just to resample the fft in log-space...

23 days ago | 0

Answered

Can MATLAB select few dll files instead of whole large MCR to run a executable program files using GUIDE?

Matlab kind of already does this in your executable file. If you, for example, try to compile some p-files it is possible that t...

Can MATLAB select few dll files instead of whole large MCR to run a executable program files using GUIDE?

Matlab kind of already does this in your executable file. If you, for example, try to compile some p-files it is possible that t...

23 days ago | 0

Answered

How can I incoporate choice set information in the multinomial logistic regression?

What you expect to gain giving the set information? If you do it individually per costumer you lose almost all of your generaliz...

How can I incoporate choice set information in the multinomial logistic regression?

What you expect to gain giving the set information? If you do it individually per costumer you lose almost all of your generaliz...

23 days ago | 0

Answered

Matlab returns different values with two equivalent functions

The difference between then in my computer with your example is -3.197442310920451e-14 (depending of your processor may be sligh...

Matlab returns different values with two equivalent functions

The difference between then in my computer with your example is -3.197442310920451e-14 (depending of your processor may be sligh...

1 month ago | 1

| accepted

Answered

Scaling Objective Function for Widely Varying Parameters: Data Fitting with lsqcurvefit

The main problem actually isn't the scaling but rather the optimization algorithm. Your function seems to be extremely non-smoot...

Scaling Objective Function for Widely Varying Parameters: Data Fitting with lsqcurvefit

The main problem actually isn't the scaling but rather the optimization algorithm. Your function seems to be extremely non-smoot...

1 month ago | 0

| accepted

Answered

Error in Saving mat file

You can use the version 7,3 like this: save('DATA.mat','DATA','-v7.3');

Error in Saving mat file

You can use the version 7,3 like this: save('DATA.mat','DATA','-v7.3');

1 month ago | 0

Answered

Opening Multiple Gui Problem

When you do save CVD save PVD ... you're actually saving your whole workspace, and thus later when you load it, you, at the...

Opening Multiple Gui Problem

When you do save CVD save PVD ... you're actually saving your whole workspace, and thus later when you load it, you, at the...

1 month ago | 0

| accepted

Answered

How to generate noise from 950 to 1050 Hz for 0.2 sec?

Choose Fs, generate broadband noise, filter with a bandpass: Fs = 44100; Tmax = 0.2; Samples = Tmax*Fs; noise = randn(Samp...

How to generate noise from 950 to 1050 Hz for 0.2 sec?

Choose Fs, generate broadband noise, filter with a bandpass: Fs = 44100; Tmax = 0.2; Samples = Tmax*Fs; noise = randn(Samp...

1 month ago | 1

| accepted

Answered

Inverse Fourier transform from logged fft data

You can't exactly reconstruct the time signal since you lost the phase information while transforming it to dB. The best you can...

Inverse Fourier transform from logged fft data

You can't exactly reconstruct the time signal since you lost the phase information while transforming it to dB. The best you can...

1 month ago | 0

| accepted

Answered

Question on generating echo effect

Try this function [eSound]=audioEcho( audioVec, Fs, delay,echoGain) delaySamples= round(Fs * delay); delayVec = zeros(size(...

Question on generating echo effect

Try this function [eSound]=audioEcho( audioVec, Fs, delay,echoGain) delaySamples= round(Fs * delay); delayVec = zeros(size(...

1 month ago | 0

| accepted

Answered

Method to plug in a value

I would agree with dpb that the best way is to use anonymous functions, the only thing that you additionally need is to be able ...

Method to plug in a value

I would agree with dpb that the best way is to use anonymous functions, the only thing that you additionally need is to be able ...

1 month ago | 0

| accepted

Answered

I need matlab code to generate smooth curve for data set

if you look at the result you will see the fit function for each curve. In your actual image the "f(x)=a*x^b+c" with the coeffic...

I need matlab code to generate smooth curve for data set

if you look at the result you will see the fit function for each curve. In your actual image the "f(x)=a*x^b+c" with the coeffic...

1 month ago | 0

Answered

Unable to perform assignment because the size of the left side is 4-by-1 and the size of the right side is 4-by-4 Error.

The dimensions of your X point and your step are wrong (1x4 and 4x1), you can just transpose one of them to fix your problem X ...

Unable to perform assignment because the size of the left side is 4-by-1 and the size of the right side is 4-by-4 Error.

The dimensions of your X point and your step are wrong (1x4 and 4x1), you can just transpose one of them to fix your problem X ...

1 month ago | 0

Answered

Write a syntax to plot a 2D graph of function 1/( 2x^2 - 1).

x = 1:10; y = 1./(2*x.^2-1); figure,plot(x,y)

Write a syntax to plot a 2D graph of function 1/( 2x^2 - 1).

x = 1:10; y = 1./(2*x.^2-1); figure,plot(x,y)

1 month ago | 0

Answered

Solve optimization problem using fmincon

The answer depends on how you define your problem. If y is variable and it should be minimized together with your x than it belo...

Solve optimization problem using fmincon

The answer depends on how you define your problem. If y is variable and it should be minimized together with your x than it belo...

1 month ago | 0

Answered

Hi, I am new to MATLAB. I was trying to subtract the consecutive number in the series with the previous number and then storing this number to a new matrix. I implemented the following code but I need some help.

In Matlab what you want to do is a one line code, you should always try to vectorize your operations or use build in function, s...

Hi, I am new to MATLAB. I was trying to subtract the consecutive number in the series with the previous number and then storing this number to a new matrix. I implemented the following code but I need some help.

In Matlab what you want to do is a one line code, you should always try to vectorize your operations or use build in function, s...

1 month ago | 0

Answered

fitting 2d data set fit function is not working

The problem is that your z data is defined in a grid while your x and y define only the vectors of this grid. If you first actua...

fitting 2d data set fit function is not working

The problem is that your z data is defined in a grid while your x and y define only the vectors of this grid. If you first actua...

1 month ago | 0

| accepted