Answered
How to find matrix S, given by this equation
L is NxN and 0_(N-1) is (N-1)x1 ? J_delta is a full (N-1)x(N-1) matrix ? Then use the eigenvector corresponding to the eigenval...

4 years ago | 0

Answered
Is there any way to solve an ineuality with syms?
You could try solving the equation psi - phi == 0 for r_t, but I doubt that MATLAB's "solve" will offer a solution.

4 years ago | 0

Answered
MATLAB gets the inverse of the matrix wrong
%Initial guesses: teta1=50; teta2=40; teta3=30; teta4=60; teta5=20; teta6=15; x1=0.2; y=0.65; x0 = [teta1, teta2, teta3...

4 years ago | 0

Answered
Find intersections of curves
bL = 0 is the intersection point. hold on plot(0,0,'.')

4 years ago | 0

Answered
Using "fminimax" in Matlab to solve the Max-Min programming problem
Yes, [0 0 0 0] is the correct solution to your problem. For all other c vectors >= 0, min g(x,c) would be negative. Since your...

4 years ago | 1

| accepted

Answered
Graphing a 2nd order ODE
function dydt = order2(t,y) dydt = zeros(size(y)); a = 2.4; %coefficient for y. term b = 1.44; %coefficient for y term m ...

4 years ago | 0

Answered
how can I create meshgrid of given data?
Use "ndgrid" instead of "meshgrid". "meshgrid" is for 2d- and 3d-grids.

4 years ago | 1

| accepted

Answered
Solving for two variables using 4th order Runga Kutta Method
Define your functions for du/dr and dt/dr in the line f = @(r,y) ... and adapt the settings in the calling program according to ...

4 years ago | 0

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

Load more