Answered

How to plot histogram of a given pdf

@Sudhir Sahoo, Here is a script that evaluates the density. Are there restrictions on what the allowed values are for m? You...

How to plot histogram of a given pdf

@Sudhir Sahoo, Here is a script that evaluates the density. Are there restrictions on what the allowed values are for m? You...

2 días ago | 0

Answered

What is the reference magnitude/amplitude for calculating dB in the power colorbar using STFT?

@Jan Ali, The values plotted on the spectrogram are the power spectral density. The p.s.d. is a way of normalizing a power spe...

What is the reference magnitude/amplitude for calculating dB in the power colorbar using STFT?

@Jan Ali, The values plotted on the spectrogram are the power spectral density. The p.s.d. is a way of normalizing a power spe...

2 días ago | 2

| accepted

Answered

What is the reference magnitude/amplitude for calculating dB in the power colorbar using STFT?

The reference for the dB calculation is a signal whose rms amplitude and power are unity.

What is the reference magnitude/amplitude for calculating dB in the power colorbar using STFT?

The reference for the dB calculation is a signal whose rms amplitude and power are unity.

5 días ago | 1

Answered

How to code for this equation based on euler's, Huen's and 4th order Range Kutta method of ODE on MATLAB. Please Help.

@Anil Maddipatla, You're welcome. To plot all three solutions on one plot, I recommend that you name the solutions c1, c2, c3 ...

How to code for this equation based on euler's, Huen's and 4th order Range Kutta method of ODE on MATLAB. Please Help.

@Anil Maddipatla, You're welcome. To plot all three solutions on one plot, I recommend that you name the solutions c1, c2, c3 ...

6 días ago | 0

Answered

calculate distance with latitude and longitude

@ELISABETTA BILLOTTA I assume you know the standard formula for distance betwen two points whose longitudes () and latitudes ()...

calculate distance with latitude and longitude

@ELISABETTA BILLOTTA I assume you know the standard formula for distance betwen two points whose longitudes () and latitudes ()...

6 días ago | 0

| accepted

Answered

How to code for this equation based on euler's, Huen's and 4th order Range Kutta method of ODE on MATLAB. Please Help.

@Anil Maddipatla, What have you tried so far, and what errors do you get? The three methods you have cited are for solving a d...

How to code for this equation based on euler's, Huen's and 4th order Range Kutta method of ODE on MATLAB. Please Help.

@Anil Maddipatla, What have you tried so far, and what errors do you get? The three methods you have cited are for solving a d...

6 días ago | 0

| accepted

Answered

ode 45 doesnt work

@Naor t, It doesn;t work because you define y0=[-1 8], a vector with 2 elements. Therefore ode45() gets into trouble when it tr...

ode 45 doesnt work

@Naor t, It doesn;t work because you define y0=[-1 8], a vector with 2 elements. Therefore ode45() gets into trouble when it tr...

6 días ago | 1

| accepted

Answered

How can I write a custom complex mathematical expression?

@KUMAR TRIPATHY, I recommend that you read the Matlab help on writing functions. Here is an example of how you can create the ...

How can I write a custom complex mathematical expression?

@KUMAR TRIPATHY, I recommend that you read the Matlab help on writing functions. Here is an example of how you can create the ...

7 días ago | 0

Answered

How to make weighted random sampling for matrix

@Michele Pio Papasidero, Function x=weightedRandomSample(v,p), attached, does what you have requested. It returns a random samp...

How to make weighted random sampling for matrix

@Michele Pio Papasidero, Function x=weightedRandomSample(v,p), attached, does what you have requested. It returns a random samp...

7 días ago | 0

Answered

Curve Fitting an equation

@Arjun Siddharth, EI appears as a constant factor in the denominator of eq. 16 for . Therefore if you use a different value of ...

Curve Fitting an equation

@Arjun Siddharth, EI appears as a constant factor in the denominator of eq. 16 for . Therefore if you use a different value of ...

19 días ago | 0

| accepted

Answered

Error message odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);

@Chris Li, Your function myode() returns 4 quantities: dydt, NA, NB, and Ff. function [dydt, NA, NB, Ff] = myode(t, y, n) I'm...

Error message odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);

@Chris Li, Your function myode() returns 4 quantities: dydt, NA, NB, and Ff. function [dydt, NA, NB, Ff] = myode(t, y, n) I'm...

19 días ago | 0

Answered

Probability vector from a Markov Transition Matrix

@Daniel Caballero, I used the code and ideas I posted in the earlier answer, with appropriate constants for your particular mode...

Probability vector from a Markov Transition Matrix

@Daniel Caballero, I used the code and ideas I posted in the earlier answer, with appropriate constants for your particular mode...

20 días ago | 0

| accepted

Answered

Wind rose - collateral points, continuous circle at 50% and the percentages on a line (west to center)

@Jacqueline Rigatto, That's 400 lines of code! Check out https://www.mathworks.com/matlabcentral/fileexchange/47248-wind-rose ...

Wind rose - collateral points, continuous circle at 50% and the percentages on a line (west to center)

@Jacqueline Rigatto, That's 400 lines of code! Check out https://www.mathworks.com/matlabcentral/fileexchange/47248-wind-rose ...

23 días ago | 0

Answered

Finding a parameters of nonlinear equations

@Adel Khaled, I would do this analytically, at least for a while. SOme of your posting was cut off on th left edge, but here's ...

Finding a parameters of nonlinear equations

@Adel Khaled, I would do this analytically, at least for a while. SOme of your posting was cut off on th left edge, but here's ...

24 días ago | 0

Answered

ode23, ode45 acting weird - why?

@David Goodmanson, Thank you for your thoughts and for running the code. I am glad to know that you got similar results. As fo...

ode23, ode45 acting weird - why?

@David Goodmanson, Thank you for your thoughts and for running the code. I am glad to know that you got similar results. As fo...

24 días ago | 0

Answered

Data fitting with custom equation

@Somnath Kale, fmincon() is a very good general purpose routine to find the parameters that give a good fit to your data. Read...

Data fitting with custom equation

@Somnath Kale, fmincon() is a very good general purpose routine to find the parameters that give a good fit to your data. Read...

24 días ago | 0

| accepted

Answered

2nd order differential errors

@John Masters, Are you getting an error message? If so, what? I notice that your dydt is mising a "*" after C.

2nd order differential errors

@John Masters, Are you getting an error message? If so, what? I notice that your dydt is mising a "*" after C.

24 días ago | 0

Answered

Step Function for Checking if Point is inside Spherocylinder

@Mari Teli, I do not understand what spherocylinder() is supposed to do, because your question does not seem to match the output...

Step Function for Checking if Point is inside Spherocylinder

@Mari Teli, I do not understand what spherocylinder() is supposed to do, because your question does not seem to match the output...

24 días ago | 0

Answered

set extrapolation to connect last point values to the first (extrapolated) ones with interp1

@gabriele fadanelli, Since you know your function is periodic with period 365, add a new last point to x() and to y(). The new ...

set extrapolation to connect last point values to the first (extrapolated) ones with interp1

@gabriele fadanelli, Since you know your function is periodic with period 365, add a new last point to x() and to y(). The new ...

25 días ago | 0

Answered

Factorial(1000) as number

@Khannanov Shamil, You want to calculate n! ~ sqrt(2*pi*n) * (n/e)^n (Stirling's approximation) but it is too big when n>170...

Factorial(1000) as number

@Khannanov Shamil, You want to calculate n! ~ sqrt(2*pi*n) * (n/e)^n (Stirling's approximation) but it is too big when n>170...

25 días ago | 1

Answered

Factorial(1000) as number

@Khannanov Shamil, I agree with the suggesiton to use Sritlin's approximation and just report the log of the factorial: where...

Factorial(1000) as number

@Khannanov Shamil, I agree with the suggesiton to use Sritlin's approximation and just report the log of the factorial: where...

25 días ago | 0

Question

ode23, ode45 acting weird - why?

I am integrating a pair of simple non-stiff first order differential equations. The output, using ode45(), is as expected, when...

25 días ago | 2 answers | 0

Answered

Error using odearguments (line 113) Inputs must be floats, namely single or double.

@Quanshun An, I recommend that you remove the syms command at the top of your code. You have defined a bunch of constants in t...

Error using odearguments (line 113) Inputs must be floats, namely single or double.

@Quanshun An, I recommend that you remove the syms command at the top of your code. You have defined a bunch of constants in t...

25 días ago | 0

Answered

use fitdist() to fit normal distribution with GIVEN MEANS.

@gabriele fadanelli, If the mean is known in advance, then the maximum likelihood estimator for is which is easy to calcul...

use fitdist() to fit normal distribution with GIVEN MEANS.

@gabriele fadanelli, If the mean is known in advance, then the maximum likelihood estimator for is which is easy to calcul...

25 días ago | 1

| accepted

Answered

Problem with time span when integrating with ODE45

@Samuele Bolotta, I think it would be easier to understand your issue if you show your main program that calls ode45(). YOu wa...

Problem with time span when integrating with ODE45

@Samuele Bolotta, I think it would be easier to understand your issue if you show your main program that calls ode45(). YOu wa...

alrededor de 1 mes ago | 1

| accepted

Answered

Take average of multiple matrices

@Amir Hosein Shokouhy, Here is a solution: >> D=open('data.mat'); >> phi=D.phi_BFD_v_sum; >> phiAvg=zeros(6,5); >> for i=1:...

Take average of multiple matrices

@Amir Hosein Shokouhy, Here is a solution: >> D=open('data.mat'); >> phi=D.phi_BFD_v_sum; >> phiAvg=zeros(6,5); >> for i=1:...

alrededor de 1 mes ago | 1

| accepted

Answered

optimisation: lsqnonlin and fminsearchbnd

@Malgorzata Wieteska, You said you want to ensure that the solutions to a set of differential equations are positive. There is ...

optimisation: lsqnonlin and fminsearchbnd

@Malgorzata Wieteska, You said you want to ensure that the solutions to a set of differential equations are positive. There is ...

alrededor de 1 mes ago | 0

Answered

log10 vs semilog

@Samantha Cole In the first case, the actual value Draincurrent is plotted on the vertical axis, and the vertical axis has log ...

log10 vs semilog

@Samantha Cole In the first case, the actual value Draincurrent is plotted on the vertical axis, and the vertical axis has log ...

alrededor de 1 mes ago | 0

Answered

Implementing a code from Berkley Madonna into Matlab

Justin, The attached code shows a way to solve differential equaitons like yours in Matlab, and plot the results. The output is...

Implementing a code from Berkley Madonna into Matlab

Justin, The attached code shows a way to solve differential equaitons like yours in Matlab, and plot the results. The output is...

alrededor de 1 mes ago | 0

Answered

How to create a subplot of multiple plots within a for loop?

@Alston D'Souza, The atattahced code makes one figure on each pass through the main loop of your code: four passes, four figures...

How to create a subplot of multiple plots within a for loop?

@Alston D'Souza, The atattahced code makes one figure on each pass through the main loop of your code: four passes, four figures...

alrededor de 1 mes ago | 0