Answered
Modeling Semiconductors using Poisson's Equation & PDE Equation Toolbox
If you have boundary conditions on both ends, use bvp4c. Else use one of the ODE solvers (e.g. ode45). Set y(1) = psi_i, y(2...

4 years ago | 0

Answered
How to solve 2 non linear circle equations with vector inputs?
f(1)=(Cr^2)-((xx-Ch)^2)+((yy-Ck)^2); f(2)=(Gr^2)-((xx-Gh)^2)+((yy-Gk)^2); instead of f(1)=(Cr^2)==((xx-Ch)^2)+((yy-Ck)^2); f...

4 years ago | 0

Answered
Error when implementing Newton's method
i=1; x(i) =rand; y(i) =rand; f(i) = (1-x(i))^2 + 100*(y(i)-x(i)^2)^2; while f(i) > 1e-6 && i <20000 fx(i) = 2*x(i)-2+40...

4 years ago | 2

| accepted

Answered
Vector ODE solution is not periodic/ as expected
r = [2408.8; -6442.7;-0000.0]; v = [4.2908; 1.6052; 6.0795]; %rDot x = [r;v]; DU = norm(r); y0 = [r;v]; span = [0 20*pi]; ...

4 years ago | 0

Answered
Matlab returns answer with another variable z. What does this mean?
Use SolUsb = solve(eqn, Usb, 'MaxDegree', 3) instead.

4 years ago | 0

Answered
Use symbolic variable for lyapunov function
syms k_p k_d h A = sym('A', [3 3]); X = sym('X', [3 3]); A = [sym('0') sym('1') sym('0'); -k_p -k_d sym('0'); sym...

4 years ago | 0

Answered
Plotting of different nonlinear equations in different ranges segment wise in a single graph
x = 0:0.01:2; b = 0.3; c = 0.7; y = zeros(size(x)); idx = x>=0 & x<=0.3; y(idx) = 1 + sqrt(1+2*x(idx)); ...

4 years ago | 0

Answered
Solving for a missing variable, I'm trying to solve for the value for Vc, but not sure how to write the code for it.
syms Vc eqn = ((100-Vc)/8)+7+((Vc-0)/6)==0 ; Vcnum = double(solve(eqn,Vc))

4 years ago | 1

Answered
how to factor a analytic expression ?
F = factor(A) ; A = F(1)*F(2); does not work ?

4 years ago | 0

Answered
'MY_ODE_WITHOUT_TLD returns a vector of length 2688, but the length of initial conditions vector is 2' why this error is showing?
The array dydt has 2688 elements (most probably because the vector ugdd has 2687 elements). The ode solver expects dydt of leng...

4 years ago | 1

Answered
How to solve a complicated algebraic equation with symbolic toolbox?
Either delta_w = k*pi (k integer) or delta_w = acos(((p1*e2)^2 + (p2*e1)^2 - (p1-p2)^2)/(2*p1*p2*e1*e2))

4 years ago | 1

| accepted

Answered
Trying to make a variable change between time intervals then output an array to plot the change of force
L=100; t=1:0.2:300; Mw = zeros(numel(t),1); Mw(t<100) = 20; Mw(t>=100 & t<=200)=100; Mw(t>200) = 17; F...

4 years ago | 0

| accepted

Answered
how to use loop in this equation
There are some mistakes in your article. The code is based on https://arxiv.org/pdf/2010.14993.pdf % Set parameters X0...

4 years ago | 0

| accepted

Answered
Plot not shown in for loop
iter = 0; for i=0:0.01:1 iter = iter + 1; I(iter) = i; if i<0.5 M(iter)=1 elseif i<0.7 M(iter)=0.5 ...

4 years ago | 0

| accepted

Answered
Plotting graph from non linear equation in MATLAB
A = 0:0.01:2; b = 1.577e11; c = 0.74; d = 1.9296e-7; R = 5e-9; x0 = -1.0; for i = 1:numel(A) a = A(i...

4 years ago | 1

| accepted

Answered
how to select last elements of a row vector?
j_last5 = j(end-4:end);

4 years ago | 1

| accepted

Answered
Adding PMF of a binomial to a rng coin flip graph
P = 23/36; n = 10; %amount of flips done 1 million times arr = zeros(1,100000); %array to store heads in n flips j = 1; whil...

4 years ago | 0

| accepted

Answered
Unrecognized function or variable
function B2FrequencyResponse10(E, W, A) K = 1; t = (0:1.0:10)'; if E >= 0 & E < 1 y = K*A-K*A*exp(-(E)*W*t)*(E/sqrt(1-E...

4 years ago | 0

| accepted

Answered
How to get the solutions of inverse cosine (acos) in the interval [0, 2π]?
Is there a matlab function to perform this task? No. But if you want to work within the branch in [0,pi] as well as in [pi,2...

4 years ago | 2

| accepted

Answered
Newton Raphson multivariate xy equilibrium
function main %Vector de x n=100; x=linspace(0,1,n); %Vector para guardas las variables yresp = zeros(n,1); Tresp = zeros(...

4 years ago | 0

| accepted

Answered
FitGeoTransform- moving point and fixed points not working into function
The points are the rows of your matrices, and in the FixedPoints matrix, (26.5000 445.5000) and (26.5000 445.5000) as well ...

4 years ago | 0

Answered
Calculate Euclidean Distance between one point and many others
Dist = sqrt(X.^2 + Y.^2 + Z.^2)

4 years ago | 1

Answered
Why do I get an infinity number in matrix X2?
function main %A = [2 -1 1; 3 -3 9; 3 3 5]; %b = [7; 18; 14]; %x0 = [1; 0; 0]; A = [4 -1 -1; -2 6 1; -1 1 7]; ...

4 years ago | 0

Answered
Invalid index showing Index exceeds the number of array elements. Index must not exceed 1.
For i=1, the p-loop is empty since your loop index goes from p=1:i-1. Thus for i=1, a(i+1) = a(2), b(i+1) = b(2) and c(i+1) = ...

4 years ago | 0

| accepted

Answered
An error occurred when implementing gradient descent
What can I modify in my code to plot the desired contour and plot the graph in this way Change the line f = -200*(y-x^2)^2+ (1...

4 years ago | 0

| accepted

Answered
Need help to solve nonlinear ode in matlab
Write your equation as u'' = -T/(1-2*R*u'), substitute u1 = u and u2 = u' to arrive at the system u1' = u2 u2' = -T/(1-2*R*u...

4 years ago | 1

Answered
least square fitting of multiple variable equation (error: too many input arguments)
x=lsqcurvefit(@(w)distribution(w(1),w(2)),w0,EXP_x,EXP_y,lb,ub); instead of x=lsqcurvefit(@distribution,w0,EXP_x,EXP_y,lb,ub);...

4 years ago | 1

| accepted

Answered
I want to generate uniform distribution of points on the surface of a sphere
https://de.mathworks.com/matlabcentral/fileexchange/37004-suite-of-functions-to-perform-uniform-sampling-of-a-sphere

4 years ago | 0

Load more