Answered
How to run lsqcurvefit with a function handle with 2 array-variables?
rao_H2O = @(k,x) k(1)*k(2)*C_TBA_H2O./(1+k(2)*C_TBA_H2O+(k(2)*C_H2O).^gamma(2))+k(3)*C_TBA_H2O; xdata = zeros(size(rao_norm)); ...

7 years ago | 0

Answered
Can't figure out how to iterate a variable defined in ode45 function.
[time,s] = ode45(@(time,s)dampedspring(time,s,b),tspan,BC);

7 years ago | 0

Answered
A(B)=0 What is its meaning?
All numbers in the matrix A that are bigger than 0.8 are set to 0.

7 years ago | 0

Answered
FALLING FACTORIAL AND POCHHAMMER
prod(x-a+1:x)

7 years ago | 0

| accepted

Answered
How to sum all positive values in each row in matrix?
sum(max(A,0),2)

7 years ago | 0

| accepted

Answered
Lotto code,the previous number cannot appear again,how do i improve it?
x = rand(1,10); [a b] = sort(x); previous_number = b(1:6) set_for_last_number = setdiff(1:8,previous_number); pos = randi(le...

7 years ago | 0

| accepted

Answered
How to find minima from a fitted 3rd order polynomial
Solve y'(x)=0 for x and check whether f''(x) > 0.

7 years ago | 0

Answered
trying to put this integrative function in Matlab, but i dont know how.
alpha = ...; m0 = ...; h1 = ...; h2 = ...; xs = ...: fun = @(x)exp(-h1*abs(alpha)-h2*sqrt(alpha^2+m0^2))*exp(1i*alpha*(x-xs...

7 years ago | 0

| accepted

Answered
Fix the maximum number of iterations while using ode solvers
https://de.mathworks.com/matlabcentral/answers/94739-is-it-possible-to-specify-the-maximum-amount-of-time-or-number-of-function-...

7 years ago | 0

| accepted

Answered
MATLAB solving BVP using bvp4c, variable coefficient
If you make the ansatz f ( r ) = a0 + a1*r + a2*r^2 + ...+ an *r^n you will need (n+1) additional boundary conditions to fix ...

7 years ago | 0

Answered
Error in using * in Non-linear regression
Elementwise multiplication is required: modelfun = @(b,x) b(1)*(x(:,1).^b(2)).*(x(:,2).^b(3)).*(x(:,3).^b(4));

7 years ago | 0

| accepted

Answered
IMPOSING CONSTRAINTS in FMINCON
A=[0 1 1 0; 0 1 -1 0]; b=[1;0];

7 years ago | 0

| accepted

Answered
BVP PROBLEM how can we take 'c' in x-axis(continuous range.[-1.3:0.02:-1.1]) and to find f"(0)
function main S = 1; c = [-1.3:0.02:-1.1]; Pr = 0.7; n = -0.8; sol = zeros(numel(c),1); x = [3 -1]; ...

7 years ago | 0

| accepted

Answered
problem solving nonlinear equation system with fsolve
Try Maugis = @(X) [lambda*X(1)^2/2*(sqrt(X(3)^2-1)+(X(3)^2-2)*atan(sqrt(X(3)^2-1)))+4/3*lambda^2*X(1)*(sqrt(X(3)^2-1)*atan(sqrt...

7 years ago | 0

| accepted

Answered
Why does my rand function not seem to work?
You will never hit 0.3266 exactly using the "rand" command. You can use if abs(tmp-limit) < 1e-6 or something similar in you...

7 years ago | 1

| accepted

Answered
How to calculate an integral with an infinite series inside?
I get I = sum_{n=1}^{n=Inf} (1-exp(-4*n^2*t))/(4*n^2) I don't know if an analytical solution exists. Best wishes Torsten.

7 years ago | 0

Answered
How can I integrate a function which was generated by a smoothing spline?
int(i,1)=integral(@(x)feval(f,x),1.2,1.6);

7 years ago | 1

| accepted

Answered
Runge- kutta Help on solving end order Differential equation
function RungeKuttaMethod a = 0; %time interval we are solving over b = 4; N = 1000; %...

7 years ago | 1

Answered
2nd Order Nonlinear Differential Equation Solving with Central Difference Method?
http://web.mit.edu/10.001/Web/Course_Notes/Differential_Equations_Notes/node9.html

7 years ago | 1

Answered
Nonlinear 2nd order ODE with term x^2*y'' and initial value y(0)=20
https://en.wikipedia.org/wiki/Cauchy%E2%80%93Euler_equation The section Second order – solution through change of variables s...

7 years ago | 0

Answered
Numerically solve of integral equation with known Integrand
If d2z_p(i) = dv_p / dtau at tau = i * t / n = i * dt and d2z_f(i) = dv_f / dtau at tau = i * t / n = i * dt in your code from a...

7 years ago | 1

| accepted

Answered
RK4 method for system of ODEs
https://www.google.de/search?source=hp&ei=E994XNKfMYPKwALsyYLwAw&q=matlab+%26+rk4+code&btnK=Google-Suche&oq=matlab+%26+rk4+code&...

7 years ago | 0

Answered
Solve a system of equations
function main x0=zeros(8,1); sol=fminsearch(@(x)fun(x(1),x(2),x(3),x(4),x(5),x(6),x(7),x(8)),x0) sol=fminsearch(@(x)fun(x(1),...

7 years ago | 0

| accepted

Answered
In Ode15s, how do I break the time span into smaller intervals and call the solver twice, so that the integration proceeds faster?
tspan1=[t0 t1]; [ta,y1]=ode15s(@odefun,tspan1,initialCond,solverOptions,additionalParams); initialCond=y1(end,:); tspan2=[t1 ...

7 years ago | 1

Answered
Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 2.4e+02. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy.
E1=@(x)besselj(0,r/d.*x).*sqrt(x.*tanh(x)).*x.*sin(sqrt(9.81*t(i)^2/d.*x.*tanh(x))).*(sin(a/d.*x)-a./d.*x.*cos(a/d.*x))./(a/d.*x...

7 years ago | 1

Answered
less time to run how
Usually, fun is called for a vector of x-values and must return an array of the same size. ArrayValued = true forces "integral" ...

7 years ago | 0

Answered
The collocation scheme used by bvp4c is the fourth order Lobatto IIIa Runge-Kutta formula or Simpson????
From the documentation: bvp4c is a finite difference code that implements the three-stage Lobatto IIIa formula. This is a collo...

7 years ago | 0

Answered
How to get only one or two output times from ODE solver?
If you use two elements in tspan, ode15s returns the solution at intermediate output times chosen from its internal stepsize con...

7 years ago | 0

| accepted

Answered
Shooting Method On Harmonic Equation
function main ydot0_start = 1.0; a = 2.4; iflag = 0; sol = fzero(@(x)fun_shooting(x,a,iflag),ydot0_start); iflag ...

7 years ago | 1

| accepted

Answered
Parameter estimation in ODE45.
Why do you think the number of unknowns and the number of equations do not match ? You have 4 equations in 4 unknowns. (Of cours...

7 years ago | 0

| accepted

Load more