Answered
Is this how I find the area under my graph?
% ------ Finding time to climb to each altitude ------ % time_2_5_climb = trapz(final_list_2_5(:,6),final_list_2_5(:,8)) % 924...

4 years ago | 0

| accepted

Answered
How to find the coefficient matrix of a set of nonlinear equations?
There might be more elegant solutions, but this is one way you could generalize. I did it in octave ; maybe you will have to ac...

4 years ago | 1

Answered
Unable to perform assignment because the left and right sides have a different number of elements
% Input Data Parameters h=1; % Step size [s] tf=50; % Solve Space of t=[0,tf] [s] ...

4 years ago | 1

Answered
How to define a distance along a 2D nonlinear line generated by an equation, and find the corresponding distance along the x-axis?
syms x y = 5*0.12*(0.2969*sqrt(x)-0.1260*x-0.3516*x^2+0.2843*x^3-0.1015*x^4); f = sqrt(1+(diff(y,x))^2); f = matlabFunction(f...

4 years ago | 0

Answered
define matrix with variable to iterate over
function main ev = ...; hb = ...; w = (0:0.01:4)*ev/hb; D_= zeros(9,numel(w)); for n = 1:numel(w) M = Define...

4 years ago | 1

| accepted

Answered
error using sym/subindex
syms x f(x) = sqrt(1-x^3); V = pi* int(f^2,[0,1])

4 years ago | 0

Answered
for loop does not plot all the plots
plot(24*i,y1(i*100e3),'*'); instead of plot(24*n,y1(n*100e3),'*');

4 years ago | 1

Answered
How to make a solid of revolution using a function
https://de.mathworks.com/matlabcentral/fileexchange/15559-solids-of-revolution

4 years ago | 0

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

Load more