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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

16 dagen ago | 0

Answered

Calculating Electric dipole using Coulomb's law with Quiver

@Kutlu Yigitturk, I modified the program a bit and added the calculation of voltage as well as electric field strength. I thin...

Calculating Electric dipole using Coulomb's law with Quiver

@Kutlu Yigitturk, I modified the program a bit and added the calculation of voltage as well as electric field strength. I thin...

17 dagen ago | 0

| accepted

Answered

Calculating Electric dipole using Coulomb's law with Quiver

@Kutlu Yigitturk [Added this later: the code I attached to this message has one or more mistakes. Please ignore it. Sorry.] m...

Calculating Electric dipole using Coulomb's law with Quiver

@Kutlu Yigitturk [Added this later: the code I attached to this message has one or more mistakes. Please ignore it. Sorry.] m...

17 dagen ago | 0

Answered

Error in the following problem input(s): nonlcon: Not enough input arguments.

@Furkan pehlivanoglu, I assume @Walter Roberson is right that you are using the gradient in an optimization routine such as fmin...

Error in the following problem input(s): nonlcon: Not enough input arguments.

@Furkan pehlivanoglu, I assume @Walter Roberson is right that you are using the gradient in an optimization routine such as fmin...

20 dagen ago | 0

Answered

why is the answer 0.8058 ?

You get the same answer by doing mrdivide(D,D+1) See the man page for matrix right divide. Matlab finds the value of x that g...

why is the answer 0.8058 ?

You get the same answer by doing mrdivide(D,D+1) See the man page for matrix right divide. Matlab finds the value of x that g...

20 dagen ago | 2

Answered

Error in the following problem input(s): nonlcon: Not enough input arguments.

@Furkan pehlivanoglu, In function c_const(), the array dg is too small. It shouldl be 8x8, but right now it is returned as 8x3...

Error in the following problem input(s): nonlcon: Not enough input arguments.

@Furkan pehlivanoglu, In function c_const(), the array dg is too small. It shouldl be 8x8, but right now it is returned as 8x3...

20 dagen ago | 0

Answered

Need help with "mirroring" function

@Rosemaryl21, Using your equations and ranges, you would do: >> x= .05*(0:(20000/723/.05)); >> theta = acos(.0723*x / 2); >>...

Need help with "mirroring" function

@Rosemaryl21, Using your equations and ranges, you would do: >> x= .05*(0:(20000/723/.05)); >> theta = acos(.0723*x / 2); >>...

20 dagen ago | 1

| accepted

Answered

Need help with "mirroring" function

This works: >> x=0:.01:1; >> y=log(1+x); >> plot([x,x(end)+x,2*x(end)+x,3*x(end)+x],[y,flip(y),y,flip(y)]); See output plot....

Need help with "mirroring" function

This works: >> x=0:.01:1; >> y=log(1+x); >> plot([x,x(end)+x,2*x(end)+x,3*x(end)+x],[y,flip(y),y,flip(y)]); See output plot....

20 dagen ago | 0

Answered

Solving Exponencial fuction is not returning the right answer

Algebra: x=log(12734/12000)/log(1.02) >> x=log(12734/12000)/log(1.02) x = 2.9980 >>

Solving Exponencial fuction is not returning the right answer

Algebra: x=log(12734/12000)/log(1.02) >> x=log(12734/12000)/log(1.02) x = 2.9980 >>

20 dagen ago | 1

Answered

How to adjust counters for multiple for loops

@Kaylee Cornish, You can use two non-nested for loops. The second foor loop fills up the vector zbot. zbot will be 1x4. laye...

How to adjust counters for multiple for loops

@Kaylee Cornish, You can use two non-nested for loops. The second foor loop fills up the vector zbot. zbot will be 1x4. laye...

20 dagen ago | 0