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

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

4 years ago | 0

| accepted

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

4 years ago | 0

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

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

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

4 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

Answered
errors in calling function
The k-values are not known in call_myequations. So you must pass them to the function: function [t,n] = call_myequations(k1,k2,...

5 years ago | 0

Answered
exclude some elements in array
last = numel(a); idx = [6:8:last,7:8:last,8:8:last]; a(idx) = [];

5 years ago | 0

| accepted

Answered
Error using horzcat Dimensions of matrices being concatenated are not consistent.
Substitute OG at the end into the equation: OGnum = 2:2:10; W = []; for i=1:numel(OGnum) AUU = subs(AU,OG,OGnum(i)); ...

5 years ago | 0

| accepted

Answered
unable to write file permission denied
After starting Matlab, type in the command window "cd" followed by a folder where you have writing permission. See http://de.m...

5 years ago | 0

| accepted

Answered
Solving ODE and using conditions
After the call to ode45, insert (without semicolon at the end of the line) expr_at_0 = n(1,1)+2*n(1,2) expr_at_end = n(end,1)+...

5 years ago | 0

| accepted

Answered
Error in ode45
[t,n] = ode45(@(t,n)ODE(t,n,k1,k2,...),[0 1e-3],IC); Better to write an array for k with 155 entries (k(1),k(2),...) than to d...

5 years ago | 1

| accepted

Answered
ODE 45 to solve coupled ODE
To be honest, I'd prefer to know what Matlab solves. Order the variables as [z1,z2,z3,z4,z5,z6] = [y1,y2,y3,y1',y2',y3'] Then...

5 years ago | 0

Answered
NUMERICAL METHODS DISCRETISATION PROBLEM
Solve -Δv = -5/4*π^2*sin(π*x)*cos(π*y/2) by just modifying the b-vector from exercise part a). Let the solution be v. Then a...

5 years ago | 0

Answered
How to set up a function
Differentiating your equation with respect to t gives the differential equation V'(t) = Qdot/(m*R_s*T) * V(t) with solution V...

5 years ago | 0

Answered
Using the improved Euler (Huen) method, determine the approximate solution y (t) of the following starting problem:
Untested ! function main H = [1/2 ,1/4,1/8,1/16,1/32]; t0 = 0; t1 = 0.5; y0 = 1; f = @(t,y) y*exp(5*t); for i= 1:numel(...

5 years ago | 0

Load more