Answered
Include convolution integral inside ode function
Suppose you know the solution for velocity of your system of ODEs in 0*dt, 1*dt, 2*dt,..., n*dt. To calculate the solution in...

5 years ago | 0

Answered
Splitting matrix into fixed rows and N columns
M_new = M(1:30,:); For i=2:130 M_new = horzcat(M_new, M(30*(i-1)+1:30*i,:)); % M is your original matrix (3900 x 3) end...

5 years ago | 1

| accepted

Answered
Need help writing a code with a summation divided by a summation
a = [0.001, -0.014, 0.098, -0.424, 1.29, -2.96, 5.25, -7.35, 8.21, -7.3513, 5.25, -2.96, 1.297, -0.424, 0.098, -0.014, 0.001]; ...

5 years ago | 0

Answered
Find the divergence of a vector field f=xyi+yzj+zxk
https://de.mathworks.com/help/symbolic/divergence.html

5 years ago | 0

Answered
Problem - Optimization nonlinaer function
function r = myParFun(p,A,B,C,y) x = A*p(1).* exp( B*p(2)) .*exp( C*p(3)); r = myPearsonCoeff(x,y); %since optimizatio...

5 years ago | 0

| accepted

Answered
How to solve PDEs with only one side boundary conditions?
Discretize du1/dt and du2/dt in time (e.g. by backward Euler method): du1/dt @t=t_i+1 = (u1^(i+1)-u1^(i))/deltat du2/dt @t=t_i...

5 years ago | 0

Answered
I will buy labtop core i5 1135G with mx350 and ram 8 gb. Is that enough to run matlab r2020b or i should buy another laptop?
https://de.mathworks.com/support/requirements/matlab-system-requirements.html These are minimum requirements. You may choose m...

5 years ago | 0

Answered
Write a MATLAB code to Find the maxima and minima of two variable function f(x,y)=x^4+y^4-4xy+1
syms x y f(x,y) f(x,y)=x^4+y^4-4*x*y+1; dfx=diff(f,x); dfy=diff(f,y); eqns=[dfx==0,dfy==0]; vars=[x y]; S=solve(eqns,vars,...

5 years ago | 1

Answered
polynomial interpolation of satelite positions
Use interp1 for the three columns separately: t = 0:60; x = interp1(T,X,t); y = interp1(T,Y,t); z = interp1(T,Z,t); where T...

5 years ago | 0

Answered
Really am I simulation this system with ODE45? How am I can optimizing the code?
function main options = odeset('RelTol',1e-6,'AbsTol',1.0e-6,'Stats','on'); tspan = (0:0.1:8.9); %========================...

5 years ago | 0

| accepted

Answered
solution of equation code of transcedental equation
function kps3 T2 = 1e-9:1e-9:1e-6; for j=1:numel(T2) t2 = T2(j); p0 = 0.5; p1 = 1; p2 = 1.5; TO...

5 years ago | 0

| accepted

Answered
Solve time-dependent ODE using the result from another time-dependent ODE
function main IC = [0;0]; S_span = [78.809 80]; opts = odeset('RelTol',1e-4,'AbsTol',1e-4); [S, y] = ode45(@fun, S_s...

5 years ago | 0

| accepted

Answered
How to solve for k
syms CR k m n solve(CR==m*n/(k*(m+n+1)),k)

5 years ago | 0

Answered
Drawing cumulative probability graph
xcoord = 1:25; ycoord = cumsum(X); figure stairs(xcoord,ycoord)

5 years ago | 0

Answered
My plot doesnt exist
result = zeros(size(H)); for i=1:numel(H) if H(i)<=1499 result(i) = (cvmin*vstall)+vdcl1; elseif H(i)>1499 &...

5 years ago | 0

Answered
How can I fix my for loop for a second order Runge Kutta Scheme?
x = zeros(1,10); x(1) = 1; t = 0:deltat:0.9; for i = 1:9 k1 = f(x(i),t(i)); k2 = f(x(i) + deltat*k1,t(i+1)); x...

5 years ago | 0

| accepted

Answered
Set fsolve tolerance for root finding
Use OutputFcn to implement your individual stopping criterion. See de.mathworks.com/help/optim/ug/output-function.html for mo...

5 years ago | 0

| accepted

Answered
summation inside for loop
vec = ones(1,5)*Q_z.' ; exp2(1:100,:) = vec ;

5 years ago | 0

Answered
Using the \ operator to fit a parabolic curve to a data set.
Replace x by x = [h.^2 h ones(length(h),1)]

5 years ago | 2

| accepted

Answered
Confusing about applying weighted least square for constant fitting
X = ones(N,1) W = diag(w) Y = y where y is the (Nx1) column vector of the measurements and w is the (Nx1) column vector of we...

5 years ago | 0

Answered
Using recursive function with combination of n variables(each variable being an array of numbers)!!
mx = size(x,2); my = size(y,2); mz = size(z,2); mr = size(r,2); ms = size(s,2); [X,Y,Z,R,S] = ndgrid(1:mx,1:my,1:mz,1:mr,1:...

5 years ago | 0

Answered
Problem in solving integration inside the for loop
Possible approaches to answer the question can be read in the discussion above.

5 years ago | 0

| accepted

Answered
Finding best parametric function estimation for ODE of first order
Search for a book on optimal control of ODEs and DAEs, e.g. Matthias Gerdts: Optimal control of ODEs and DAEs De Gruyter 2011...

5 years ago | 1

| accepted

Answered
Interpolating X axis values using a Y axis value and interp1 command.
f = @(x) (interp1(Ti,Temp,x,'pchip') - 105); x0 = 3; Ti105 = fzero(f,x0)

5 years ago | 0

Answered
How to solve set of non-linear equations using fsolve. Set of non-linear equations have equality and in-equality equations.
Use fmincon instead of fsolve. Simply set the objective function to 0 and use fmincon only to determine a feasible point of your...

5 years ago | 0

| accepted

Answered
solve a system of integral equations with matlab
If you differentiate all your equations with respect to t, you get a system of differential equations that can be solved by stan...

5 years ago | 1

| accepted

Answered
How to solve the continuity equation for dark and light scenario by symbolic function with boundary condition
The equation for P reads -V_T*mu_p*P''+ F*mu_p*P'+ r_m*P - G(x) = 0. Now you can apply the boundary conditions.

5 years ago | 0

Answered
Plotting a piecewise function for an arbitrary itration and then take intersection of them.
n=5; nx=50; x1=linspace(0,1/3,nx); x2=linspace(1/3,2/3,nx); x3=linspace(2/3,1,nx); X = [x1(1:nx-1).';x2(1:nx-1).';x3.'); Y...

5 years ago | 0

Answered
Utility of Jacobian in lsqnonlin
Stability of convergence is the main reason to supply an analytic Jacobian. For computation time, it depends on the complexity...

5 years ago | 0

| accepted

Answered
How to use isAlways to compare two symbolic equations ?
syms x isAlways(sqrt(x^2)==abs(x))

5 years ago | 0

Load more