Answered
iUsing ode45, how to pass a parameter from odefun to an events function?
You'll have to calculate loadfV twice if you don't want to use globals. But you should use a third function different from BD_i...

4 years ago | 0

| accepted

Answered
How to get back the original matrix?
A = [1 2 3 2;... 4 1 2 3;... 3 4 3 2;... 2 4 1 1] R = [1 3 4 2]; B = A(R,:); Rinv(R) = 1:numel(R); A_recovere...

4 years ago | 1

| accepted

Answered
2 equations one unknown
v = sqrt(95*9.8/0.24)*tanh(sqrt(0.24*9.8/95)*8) y = 95/0.24*log(cosh(sqrt(0.24*9.8/95)*8))

4 years ago | 1

Answered
"Error using vertcat Dimensions of arrays being concatenated are not consistent." why this error showing?
function "my_ode" lacks an "end" statement.

4 years ago | 1

Answered
I want to get the values from the last two iteration
% Tolerances, Maximum number of iterations tolF = 1e-6; tolX = 1e-8; itermax = 30; % Start values xim2 = 6; ...

4 years ago | 0

Answered
How to get the output result from a jacobian as this.
jac = subs(jac,[X1,X2,X3,X4,X5,X6,X7],[X0(1),X0(2),X0(3),X0(4),X0(5),X0(6),X0(7)])

4 years ago | 0

| accepted

Answered
Calling a function inside an integration
t = 36:1:64; v = 7.65; h = 435; r = tand(15)*h; lambda = 0.21; Aeff = 0.57; for i = 1:length(t) yi = r - v*(t(i)); ...

4 years ago | 1

| accepted

Answered
how to set a loop to calculate time
t0 = 0.01; n = log(24/t0)/log(1.1); t = t0*1.1.^(0:floor(n)); t(end+1) = 24.0;

4 years ago | 0

| accepted

Answered
Store elements of a matrix but ONLY IF the respective element of ANOTHER matrix meets condition.
matriz_viaveis = NaN(size(matriz_angulodecarga)); for x= 1:size(matriz_angulodecarga,1) for y = 1:size(matriz_angulodecarg...

4 years ago | 1

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
t=linspace(0,50,501); vel=zeros(1,501); %d=zeros(1,501); dT = zeros(1,501); dT(1) = 0.1; vel(1) = 20; for n=1:500 if ...

4 years ago | 0

Answered
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side
I doubt that "computeF1clustering" returns one single real number, does it ? That's what you assume when you try to write the r...

4 years ago | 0

Answered
Saving to Arrays in for loop
Qe = 12; M = 1002; aArr = zeros(M,1); eArr = zeros(M,1); daArr = zeros(M-1,1); deArr = zeros(M-1,1); T = [0:1000]; eArr(1...

4 years ago | 0

| accepted

Answered
How to specify a 3 element column vector in Euler's Method for ODE
Here is a hint: https://de.mathworks.com/matlabcentral/answers/1676979-how-do-i-use-euler-s-forward-difference-method-and-the-s...

4 years ago | 0

| accepted

Answered
Numerical integration (vpaintegral) of bessel function of the second kind (bessely)
Plot bessely(1,rho) in the interval [0,1]. Seems there is a singularity at x=0.

4 years ago | 1

Answered
trigonometric equation solution help
When I plot the function for several values of err and space, I only see a zero at k=0 and k=0.5. Can you give values for err a...

4 years ago | 0

| accepted

Answered
How to get a loop to converge
And what do you want to get with J_BF_inB(q*b) ? q*b at the first place is undefined. And even if it were defined, what is M...

4 years ago | 0

Answered
Optimization Toolbox Defining Constraints
https://de.mathworks.com/help/optim/problem-based-approach.html And better use "intlinprog" instead of the "ga" - solver if the...

4 years ago | 0

| accepted

Answered
plotting a function which is an Integral
a=1; fun = @(z,x) z.^a./sinh(z).*1./(x.^2+z.^2); X = 0:0.1:50; for i = 1:numel(X) x = X(i); F(i) = x*sin(x)*integra...

4 years ago | 0

| accepted

Answered
I have 2 independent variables and one dependent variable. I would like to get a polynomial equation and surface plot passing through the data points?
M = [0.970446735 0.068181818 0.2 0.894959908 0.068181818 0.4 0.779725086 0.068181818 0.6 0.61489118 0.068181818 0...

4 years ago | 0

| accepted

Answered
Hi! I want to make a 2D random walk that can run multiple times, and I also want to record the final destination of each walk.
NUMSTEP = 1000; NUMWALK = 100; xfinal = zeros(NUMWALK,1); yfinal = zeros(NUMWALK,1) for i = 1:NUMWALK x = 0; y = 0...

4 years ago | 0

| accepted

Answered
How do I use the random function in Fsolve Matlab?
This might help to get beta as a function of x: X = (0*2000/1100:0.1:2000/1100+10).'; n = 1e4; trials = 1e3; beta = zeros(...

4 years ago | 0

| accepted

Answered
How to solve differential equation where constant is a changing index
rng('default') a = 1000; %length of bed b = 200; %height of bed x = linspace(0,1000,100); bed = ((-.2*x + b) + (a/100.*rand...

4 years ago | 0

| accepted

Answered
Write a vector z with y
z = sign(y)

4 years ago | 1

Answered
buondary condition derivative equal zero PDE
rho = 8900; cp = 600; D = 15; a = D/(rho*cp); R = 0.05; uR = 25 + 273.15; u0 = 1000 + 273.15; rstart = 0.0; rend = R; ...

4 years ago | 0

| accepted

Answered
Output the value of the variable from the for loop to the matrix
for i = 1:... ? if z(1) <=3e5 ... else ... end G_drenazh_m(i,:) = [t,G_drenzah]; end save('G_drenazh.m...

4 years ago | 0

Answered
System of equations with an array of inputs and outputs
R = 9100; R2 = 2200; R3 = 47000; Vi = 3.3; syms dR V1 V2 Vp Vo eqn1 = R2*dR*Vi - R2*dR.*V1 == R*dR.*V1 - R*dR.*Vp + R*R2*V1...

4 years ago | 0

| accepted

Answered
How to solve the distance between two sets of points. Thanks a lot for your answer.
https://de.mathworks.com/help/stats/pdist.html

4 years ago | 0

Answered
How can I find s that satisfies the expression?
z = [...]; % vector of zi values Keq = [...]; % vector of corresponding Keq values fun = @(s) sum(...

4 years ago | 1

| accepted

Load more