Answered
Solve the following eigenvalue problem using Matlab
Still confused ? Then read about "eig". B = [ 3 0 0 ; 0 2 2 ; 0 0 1] ; ...

4 years ago | 1

| accepted

Answered
Random Numbers from Stationary Distribution
If you write D as an array D=[1/120,1/120,...,1/120] then the following code should work: DC = cumsum(D); for i = 1:100 r...

4 years ago | 0

Answered
how can i estimate parameters that must be real from a complex model?
f = [...]; %your data row vector; eps_v = [...]; %your data row vector; %Initial values for parameters to be fitted eps_r...

4 years ago | 1

| accepted

Answered
Solve nonlinear equations with condition
Use "fmincon" with the objective (1-2*cos(5*a(1))+2*cos(5*a(2)))^2 + (1-2*cos(a(1))+2*cos(a(2))-pi/5)^2 with the linear constr...

4 years ago | 1

Answered
Using verticalregion for integral
x=[0 1 1]; y=[0 0 1]; fill(x,y,'b')

4 years ago | 0

Answered
Computing Double integrals with ymax
F = @(x,y) y.*sqrt(x.^2 - y.^2); instead of F = @(x,y) y*sqrt(x.^2 - y.^2);

4 years ago | 0

| accepted

Answered
Two surface with different value of x axis
surf(X1,Y,Z1) hold on surf(X2,Y,Z2) Or what do you mean ?

4 years ago | 0

| accepted

Answered
Temperature matrix giving NaN
%% initialisation alpha1=0.02; a=0.6; b=0.05; c=0.01; q=0.05; g=20; L=4; tmax=100; dx=0.01; nx=L/dx+1; dt=0.005; nt=...

4 years ago | 1

Answered
Using Runge-Kutta algorithm to solve second order ODE
Can you take it from here ? %Solves y'' - (-exp(-B*t)-y+5*exp(-2*t)-2*exp(-(B+2)*t)+exp(-B*t)+t) = 0 % t in [0 1] % y(0) ...

4 years ago | 0

Answered
solve the system of linear equation
Q0 = 356; tspan = [0,100]; Qsol = 300; Qliq = 400; T_mp = ...; C = ...; E = ...; F = ...; H = ...;...

4 years ago | 0

Answered
Fitting Weibull function using nlinfit - errors for some data not others
Start with startvalues=[35 1]; instead of startvalues=[1 1]; Further, I suggest you choose f = @(F,x) (1 - exp(-(x./F(1)).^...

4 years ago | 0

| accepted

Answered
Solve 2D heat equation with a sinusoidal source with the Euler scheme and the finite difference method (FDM)
You forgot to multiply q*fun(x(i),y(j)) by dt. But why do you solve for u using \ ? It's not necessary for the explicit Euler ...

4 years ago | 0

Answered
I am trying to imput tanh^4(0.5x) e^−sin2(x) into matlab but I am not sure how.
syms x f = (tanh(0.5*x))^4*exp(−sin(2*x)); df = diff(f,x) What is the difference formula ?

4 years ago | 0

Answered
Is there a way to change the MatLab default settings to default DockControls to off?
From the documentation: DockControls — Interactive figure docking 'on' (default) | 'off' Interactive figure d...

4 years ago | 0

Answered
Im solving for the EOM of a 3 DOF vibrations problem with ode 45 and am having trouble getting the indices to agree when I try to store the equations in my ydot term.
Maybe y = y.'; ydot(1:3,1) = y(4:6); ydot(4:6,1) = M^-1*F-M^-1*K*y(1:3)-M^-1*C*y(4:6);

4 years ago | 0

Answered
modeling a kinetic reaction network with changing concentration
Define x(1) in the k-loop: ... x=zeros(6,1); % 6 species %initialvalues: %x(1) = Ab_0; % tracking antibody x(2) = CD70_0; %...

4 years ago | 0

Answered
unrecognized function or variable
j will always equal i since both are n. So conss19 is not existent.

4 years ago | 0

| accepted

Answered
Finding elements common to both arrays
Use v = intersect(A,B)

4 years ago | 0

| accepted

Answered
Iterating an equation using while loop
k = 1.4; Ar = 50; Ma_guess = 0.1; % Initial Mach number guess fun = @(M) Ar - (1/M)*((2/(k+1))*(1+((k-1)/2)*(M)^2))^((k+1)/(2...

4 years ago | 0

Answered
Differentiation with symbolic function giving NaN value upon repeatedly executing
And why don't you simply evaluate exp(z^2)/(z-3) at z=2 to get the residual at z=2 and exp(z^2)/(z-2) at z=3 to get the resid...

4 years ago | 1

| accepted

Answered
Need help solving system of nonlinear equation with 4 equations and 4 unknowns
So you gave numerical values to all the other parameters involved except a,b,c and d ? Then a_sol = double(result.a) should w...

4 years ago | 1

Answered
Generate Random Numbers to satisfy a variable on the left and right hand side
ok. This code should return M1, given M2 and a starting guess for M1, such that the pair (M1,M2) satisfies Ctheta2_exitvolut...

4 years ago | 0

Answered
To solve : System of differential equations with multiple derivative in each equation
Insert the expression of the third equation for dh_m/dt into the first equation and solve for dh/dt. Insert the so obtained exp...

4 years ago | 1

| accepted

Answered
dsolve isn't solving my symbolic ODE correctly
Is a/b resp. c/d above always positive ? Otherwise, you'll get exp-terms in the solution of the homogenous system. Maybe you ca...

4 years ago | 0

Answered
Solving second order non-linear partial differential in three independent variables
Interpret teta as time. Discretize the dT/dz, 1/r*d/dr(r*dT/dr) expressions in space. You'll arrive at a system of ordinary di...

4 years ago | 0

Answered
ode solvers state solution numerical errors
Look at the references at the bottom of the pages describing the codes, e.g. at the bottom of https://de.mathworks.com/help/mat...

4 years ago | 1

Answered
Matlab Optimiser - Number of Evaluations.
https://de.mathworks.com/matlabcentral/answers/423275-how-to-count-the-number-of-function-calls-without-modifying-it-by-insertin...

4 years ago | 0

Answered
How can I create a script that solves a function for temperatures over a length?
z is a vector. If you use short-circuit AND (&&) , each expression in the if condition must evaluate to a scalar. This is not t...

4 years ago | 0

Answered
ppval and polyval giving different results
I think you fed "polyval" with the coefficients cut to a certain number of digits. You must use the coefficients in full precis...

4 years ago | 0

Answered
1D Heat Equation Explicit Scheme (fixed)
You use for i=0:0.1:50 ... T(i,j) = ... But only positive integer values are possible as array indices. Thus something...

4 years ago | 1

| accepted

Load more