Respondida
Detecting an error in Muller method.
The argument of the root in the calculation of x2 must become negative. Or simply start with complex values for x1,x2 and/or x...

más de 3 años hace | 0

| aceptada

Respondida
Stability analysis of a non-linear ODE system
You won't succeed in this generality. To determine the eigenvalues, MATLAB had to solve for the roots of a polynomial of degree ...

más de 3 años hace | 0

| aceptada

Respondida
error when trying to run fit function
Seems you gave your script the name "mpower.m". This conflicts with the built-in MATLAB function with the same name. Rename ...

más de 3 años hace | 0

Respondida
How to repeat a vector over and over?
a = rand(1,1023); a = repmat(a,1,ceil(50000/1023)); a = a(1:50000)

más de 3 años hace | 1

Respondida
Plotting a summation with two variables
t = linspace(0,0.1,100); x = linspace(0,1,100).'; n = 1000; f = @(t) sum(6./(pi+6*(0:n)*pi).*sin(x.*(0:n)).*exp(-(pi/6+(0:n)*...

más de 3 años hace | 0

| aceptada

Respondida
How can I perform a summation of a freqz function
syms z k F = @(a) symsum(z^(-k),k,0,a); F(2)

más de 3 años hace | 0

| aceptada

Respondida
using lsqnonlin with constraints
% A=2*(c(1)+c(2))==u this is the constraint i want to use Then optimize with one parameter c(1) and insert c(2) = u/2 - c(1) f...

más de 3 años hace | 0

| aceptada

Respondida
Finding the truncation error in an infinite sequence
How can I speed up the calculation by determining the dynamic level where error can be reduced to the barest minimum? You mean ...

más de 3 años hace | 1

Respondida
Euler's Method with multiple step sizes
%%% Define the interval [a,b] and initial condition a = 0; b = 0.5; y0 = 1; %%% Find the approximated solution using Euler's...

más de 3 años hace | 0

| aceptada

Respondida
How Do I Plot 24 equally distanced points (from 0<t<5, inclusive) that agree with an exact solution to an IVP? (RK4/Runge Katta Method)
Use scatter([t 5/24 10/24 15/24 20/24 25/24 30/24 35/24 40/24 45/24 50/24 55/24 60/24 65/24 70/24 75/24 80/24 85/24 90/24 95/24...

más de 3 años hace | 0

| aceptada

Respondida
How to solve multiple independent equations stored in one variable
for i = 1:numel(b) for j = 1:numel(M0) eq = x^2 - (tunnel.A(i)./Aster(j)*x).^2+2 == 0; tunnelM = solve(eq, x, "...

más de 3 años hace | 0

| aceptada

Respondida
Matrix problem n*n
n = 3; A = reshape(1:n^2,n,n).'

más de 3 años hace | 0

| aceptada

Respondida
Not enough input arguments in lsqcurvefit function
x0 = 0 not x0 = [0 0] since k seems to be a scalar as you treat it in "calcor". Further I guess k= lsqcurvefit(@calcor,x0,...

más de 3 años hace | 1

Respondida
optim.problemdef.OptimizationProblem/solve SOLVE requires a non-empty initial point structure to solve a nonlinear problem.
My advice is: Do what the error message tells you to do and supply an initial point structure to make MATLAB happy. initial.e =...

más de 3 años hace | 0

Respondida
how to remove error form BVP4C code
The odes you want to solve cannot be defined in two separate ODE functions. If you want to solve two differential equations sim...

más de 3 años hace | 0

| aceptada

Respondida
fplot showing different curve to plot
plot(p_a,Q) instead of plot(Q,p_a): M = 100; p_b = 2; Q = @(p_a) M./(p_a + p_b); hold on fplot(Q, [0 35]) ylim([0 ...

más de 3 años hace | 0

| aceptada

Respondida
Numerical solution to a larger equation.
What is the zero of your choice ? fun = @(lamda2)sinh(5.9605e-08*(((1.1259e+15*lamda2^2 + 7.5126e+15)^2)^(1/2) + 7.5126e+15)^(1...

más de 3 años hace | 0

Respondida
What is wrong with my code, my equation is vdv/dy=-G*M/(y+R)^2 ?
syms G M R y v(y) Dv = diff(v,y); eqn = diff(v,y,2) == -G*M/(y+R)^2; cond = [v(0)==100,Dv(0)==0]; sol = dsolve(eqn,cond) Gn...

más de 3 años hace | 0

Respondida
How to compare elements of two vectors in MATLAB ?
A = [1 2; 3 4]; B = [1 4; 3 5]; sum(A(:)~=B(:))

más de 3 años hace | 0

| aceptada

Respondida
Problem with time steps in Runge-Kutte method
vx(i+1) = vx(i) + (1/6)*(K1(2)+2*K2(2)+2*K3(2)+K4(2))*h; vy(i+1) = vy(i) + (1/6)*(K1(4)+2*K2(4)+2*K3(4)+K4(4)...

más de 3 años hace | 1

Respondida
Travelling salesman problem - Dimension of arrays issue
To concatenate the three vectors, sqrt((Min_Dist(:,2)-SortedCoordinates(i,2)).^2+(Min_Dist(:,3)-SortedCoordinates(i,3)).^2) C...

más de 3 años hace | 0

| aceptada

Respondida
How to compute the double integral over dx and dy?
dx = 0.1; x = -0.5:dx:0.5; dy = 0.1; y = -0.5:dx:0.5; N = length(x); a = randn(N,N); b = randn(N,N); F = (a-b).^2; % Use...

más de 3 años hace | 0

Respondida
find equilirium point with all parameter known
I don't know if this solves your problem, but of course you have to reverse the order of the commands here: if (hdot(4)<0) ...

más de 3 años hace | 0

Respondida
Curve fitting the data series
The function you define as fitting function tends to Rdc + R1 + R2 + R3 + R4 + R5 as f tends to infinity very fast. In contrast...

más de 3 años hace | 0

Respondida
Using fsolve for a set of complex equations
If you want to define K_step*X_step-F_step as a function handle, you will have to define all expressions involving components of...

más de 3 años hace | 0

Respondida
how to find equlibrium point of 5 non linear system with numerical method
I don't know if the result is as expected. format long yequi = fsolve(@fun,rand(5,1)) fun(yequi) function dydt = fun(y) e...

más de 3 años hace | 0

| aceptada

Respondida
Array indices must be positive integers or logical values.
H(0) does not exist in MATLAB. Array indices start with 1. And if inv(K-W^2*M) is a matrix, you cannot save it in a scalar H(W)...

más de 3 años hace | 0

Respondida
Help with implicit functions in vector form
I have no clue why this happens since the two expressions are exactly the same. The reason is that [x y 1]*w' cannot be evaluat...

más de 3 años hace | 0

Respondida
Please Help using fsolve (error)
f1 = (5+x1+x2)/(50-2*x1-x2)^2/(20-x1) - 4e-4; f2 = (5+x1+x2)/(50-2*x1-x2)/(10-x2) - 3.7e-2; f=[f1;f2] And it seems that you d...

más de 3 años hace | 0

Respondida
Extra variable in differential equation's symbolic solution
ans1=dsolve(eqn2,'MaxDegree',3) gives the explicit (complicated) solution. For each t, root(...) means the root of the polynom...

más de 3 años hace | 1

Cargar más