Answered
optimization problem in matlab
Why using 'FiniteDifferenceStepSize'and'TypicalX'in your options if you don't want to set values for them ? [c1 c2] = minimize_...

3 years ago | 0

Answered
lsqcurvefit "assigning the function output to this expression is not supported"
Try F = @(x,xdata) bEll2+hFace2-((xdata.^2)./(bEll2.*(1 + sqrt(1 - (1 + x(1)).*(xdata.^2./bEll2.^2)))) + x(2)*xdata.^4 + x(3)*x...

3 years ago | 0

Answered
How do I solve this 1D transient convection-diffusion equation with the convection term coupled with transient boundary values?
MATLAB's "pdepe" doesn't allow you to access phi_m in all grid points. So you will have to follow one of the ways described he...

3 years ago | 0

Answered
What is the difference between "any" and "all" function?
vec = [0 5 7]; Is any element of "vec" equal to zero ? Yes, the first one: any(vec) Are all elements of "vec" equal to zero ?...

3 years ago | 1

Answered
Solve a system of differential equations which has blkdiag
You can't supply it as a global, but only pass it as a function handle: B = @(x) blkdiag(kron(x.',eye(2))) Or you define it as...

3 years ago | 0

Answered
Keep getting a blank graph
I don't understand why you ask the same question again. It has already been anwered here: https://de.mathworks.com/matlabcentr...

3 years ago | 0

Answered
error while solving the coupled ode
% Defining parameters delta = 0.02; % Lower integral bound R = 5; % Upper integral bound theta = 0; ...

3 years ago | 1

| accepted

Answered
How can I get a variable that starts in t=0?
y = cumprod([500;ins_urz])

3 years ago | 1

| accepted

Answered
save loop data with non integer steps
reduced_scattering_coeff = 10; absorbing_coeff = 1; source_detector_distance= 1.5; refection_parameter= 3.25; absorbing_coef...

3 years ago | 0

| accepted

Answered
Trouble calculating Fourier series coefficients for full wave rectified sine wave.
clear % Create symbolic variable syms t % Define variables for waveform A=170; f0=60; T0=1/60; n=1:100; % Initial ...

3 years ago | 0

| accepted

Answered
Help with fmincon, non-linear constraints and binary variables
It doesn't work because fmincon only handles continuous variables and functions. Use "intlinprog" instead. Here you can define ...

3 years ago | 2

| accepted

Answered
Biological Effective Dose (BED)
Assuming you have two arrays (time_h and TAC) of the same length: AlphaBeta = 2.6; mu = 0.3571; S = 1; int_inner = cumtrapz(...

3 years ago | 0

| accepted

Answered
Is there a way to reduce execution time of the following because it took 6 hours and still is executing?
Are you sure you can use "ga" with stochastic inputs that change from iteration to iteration ? I doubt it. Look up "stochastic ...

3 years ago | 1

Answered
Failure at t=2.013823e-01. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (4.440892e-16) at time t.
Works. par=[1.5e-8,1.0e-8,0.1,1668115,2748508,20,50]; time=100; [sol]=SIQR(par,time); tv=0:1:time; hold on width =3; he...

3 years ago | 1

Answered
Error: Operator '*' is not supported for operands of type 'function_handle'.
cb = 1/5.25; %reverse of aspect ratio cla = 2*pi; %the slope of lift vs aoa aa = 5*pi/180; % radiant value of 5 degree N = [3...

3 years ago | 0

Answered
How can i correct my code in order to produce the solutions of a function from fsolve?
k is an array of length 22, a is an array of length 100. Both are part of your sum expression... Incompatibility is a consequenc...

3 years ago | 0

| accepted

Answered
solve system of matrices
Should be faster than the symbolic solution. rng("default") n = 50; A = rand(n-1); B = rand(n-1); C = rand(n-1); x0 = zero...

3 years ago | 0

| accepted

Answered
How can I find out the index of the points here?
X = [0,10,0,-10,0,5,0,-5] Y = [10,0,-10,0,5,0,-5,0] syms x y g1 = (y-2)/(x-1.5) == (-1.5-2)/(-1.5-1.5); g2 = (y-2)/(x-(-1....

3 years ago | 1

Answered
Trying to rearrange equation using syms
Maybe you mean syms v g LD SFC W_start W_end s eqn = s == (v*(LD))/(g*SFC)*log(W_start/W_end); sol = solve(eqn,LD)

3 years ago | 0

Answered
Solving multi-variable ODE
Use interp1 to interpolate the vector values for v and dv/dr to the values r requested by the solver. The example ODE with Tim...

3 years ago | 0

Answered
Solving multi-variable ODE
If nu(r) is known, you have to insert the expressions for nu(r) and dnu/dr in your equation for eta. If nu(r) is unknown, you m...

3 years ago | 0

Answered
I am facing error while solving two 2nd order differential equation in which boundary condition are dependent to each other. Any idea where I am doing wrong??
syms y1(z) y2(z) z C11 C12 C21 C22 K1 = 1; K2 = 1; K3 = 1; eqn1 = diff(y1,z,2) - y1/K1 == K2; eqn2 = diff(y2,z,2) == K3; s...

3 years ago | 0

Answered
evaluate a symbolic function of t that contains a derivative relative to t
It should be possible to evaluate tau right? syms Q(t) t Q_dot = diff(Q, t); tau = 2*Q + Q_dot % tau = 2*Q(t) + diff(Q(t),t)...

3 years ago | 0

Answered
Summation in MATLAB in 4 dimenstion
for t = 1:T s(t) = 0; for i=1:i <---- for i=1:i does not make sense for j=97:176 if w(i,j,15,t)<0 ...

3 years ago | 0

| accepted

Answered
ind2sub with arbitrary martix
You mean A = rand(5,6); s = size(A) ?

3 years ago | 0

Answered
Multi functions multi variables optimization
Use fmincon. Define the constraints 1<a<2; 2<b<3; 3<c<4; 4<d<5; 5<e<6 in lb and ub, define the constraints 0<F(a,b,c,d,e)<...

3 years ago | 0

| accepted

Answered
solve system by converting a matrix to vector
n = 4; A = rand(2*(n-1),2*(n-1)); b = rand(2*(n-1),n-1); x = A\b u = x(1:n-1,:) v = x(n:2*(n-1),:)

3 years ago | 1

Answered
Optimize the construction of a function for quadrature purposes
MyInt = integral(@myfun, 0, 2*pi) function Output = myfun(t) p = (1:20).'; Output = sum(1./p.*cos(p.*t) + 1./(2*p).*sin...

3 years ago | 1

| accepted

Answered
bvp4c or bvp5c code needed for 2nd order BVP having unknown parameters.
syms u(y) y syms M P h k real eqn = diff(u,y,2)-M^2*u==P; conds = [u(h)==1,u(k)==1]; dsolve(eqn,conds)

3 years ago | 0

| accepted

Answered
How to calculate R^2 using 1 - (SSR/SST)? For normal fit distribution.
In my opinion, it does not make sense to fit a linear function to the value pairs (cdf(normalfit, actual_values),Table.nonExceed...

3 years ago | 0

| accepted

Load more