Answered
Numerical integral over the whole spherical volume of a crystallite
Nd = 1e23; phi = 20; Ld = 18e-9; R = 40e-9; fun = @(r) 4*pi*r.^2.*(1-exp(phi + 1/6*(r/Ld).^2)); value_integral = Nd*integra...

7 years ago | 1

| accepted

Answered
Numerical integration with many parameters.
function main L = 1; T = 100; r = 0.03; I1 = 0.5; p = 0.005; epsilon = 0.5; beta = 0.1; rho = 0.5; ...

7 years ago | 2

| accepted

Answered
How to write a code for a bounded periodic function?
t(1) = 0; y1(1) = 600; y2(1) = 1000; h = 0.5; t_end = 5; t = 0:h:t_end; a = 2; c = 3; alfa = 10^-3; gamma = 6*10^-3; f...

7 years ago | 1

| accepted

Answered
Probability distribution of a multiple variable sum
Take samples from your empirical data and use Monte-Carlo-simulation to determine the above probability. This code should help ...

7 years ago | 1

| accepted

Answered
How can we provide minimum distance i.e. 20 between each random generated node?
I think Jan Simon's answer will at least partially solve your problem: https://de.mathworks.com/matlabcentral/answers/142322-fi...

7 years ago | 1

Answered
Optimization problem with a function of 2 parameters
TC = @(x) (QC(x(1))+FC(x(2))+ RC)/E(x(2)); lb = [1.5e-5,1000]; ub = [2.5e-5,100000]; sol = fmincon(TC,[2e-5,10000],[],[],[],[...

7 years ago | 0

| accepted

Answered
Solve a system of equations
x22 - w0 = x13 = x31 * x32 = x22 * x21 / (x22+k2*V2) * x22 = x22 * (x22/(x22+k1*V1)) / (x22+k2*V2) * x22 This gives a quad...

7 years ago | 0

| accepted

Answered
Can anyone help me in coding matlab code for Quadratically Constrained Quadratic Program (QCQP)?
function main H = [2 0 0;0 2 0;0 0 2]; f = [-1; -2 ;-3]; R = [7 0 0;0 7 0;0 0 7]; h = [-4 ;-5 ;-6]; c = 88; ...

7 years ago | 0

Answered
Solving 2nd order ODE with ODE45
M = matlabFunction(V,'vars', {'t','Y'})

7 years ago | 2

Answered
Solving two nonlinear equations
A = 0.5:0.01:2; alpha = 0.5; l00 = 1; for i = 1:numel(A) a = A(i); fun = @(l0) 1 + alpha*l0^(alpha-1) - l0 - alpha*a*(2...

7 years ago | 1

| accepted

Answered
How to plot a nonlinear equation using FSOLVE in MATLAB
K = 1:627; kp = 4500; h = 1.0e-3; d = 7.5e-3; ky0 = 1.0; Ky = zeros(numel(K),1); %fKy = zeros(numel(K),1); for i = 1:nume...

7 years ago | 0

Answered
function of integral bound
function main sol = fzero(@fun,1.0) end function res = fun(b) amin = 0; amax = b; xmin = 0; xmax = @(a) a+b...

7 years ago | 0

| accepted

Answered
How to redefine a variable inside the function?
Add the nonlinear constraint x(3) - x31*x32 = 0 in function "nonlcon". And remove the lines y33=x31*x32; x13=y33; % It shou...

7 years ago | 0

| accepted

Answered
A for loop need help ASAP
for i = 0:3:300 j = i/3 + 1; Fi(j)= atan(-(A5(1,1+i)/A5(1,2+i))); Theta(j) = acos(A5(1,3+i)); Psi(j)= atan(A3(1,3+i)...

7 years ago | 0

Answered
Solving system of ODE with dataset of variables
[t,Ts]=ode45(@(t,Ts)Temp_EH(t,Ts,time,Qin,Qout,Tin,rad,Tair,Vol_hip,Vol_ep,H_ep,AreaThermo,eair,f,dens,Cp,sigma,A,RL,eee,c1,Tran...

7 years ago | 1

| accepted

Answered
error in fmincon code
V0 = [1;2;4]; objective = @(V)[-s.',(l-q).']*V; But why do you shoot with canons on sparrows (means: why do you use a nonlinea...

7 years ago | 0

| accepted

Answered
How can i find the distance between every point in two different point-clouds
https://de.mathworks.com/help/stats/pdist2.html min (D) or min (D.') seems to be what you are looking for.

7 years ago | 1

Answered
Calculating mean for each column
mean ( R ) ?

7 years ago | 0

| accepted

Answered
complex solutions in ode23s
I guess there exist some operation in the calculation of your time derivatives that gives a complex result (e.g. sqrt of a negat...

7 years ago | 0

| accepted

Answered
Cannot get the right coefficient from PCHIP fit
From the documentation: Since the polynomial coefficients in coefs are local coefficients for each interval, you must subtract ...

7 years ago | 0

| accepted

Answered
Could anyone help me to solve the issue.
If "initial_position" is an array with 5 elements and "common_position" is a scalar, you can simply type difference = common_po...

7 years ago | 0

Answered
Fitting a straight line to a set of 3-D points
What I would do is find the average P¯of your points and an eigenvector V of the covariance matrix for its largest eigenvalue. ...

7 years ago | 0

Answered
optimizing linprog 2 variables with different dimensions
Set V = [V(1) V(2) V(3)] = [z y(1) y(2)] as "combined" solution vector and write all your equations in V instead of z and y. ...

7 years ago | 0

| accepted

Answered
fmincon or linprog use in minimization?
l = 0.25; q = 2; s = 1; A = 1; x = 20; d = 15; f= [-s, l-q]; Aeq = [1, A]; beq = x; lb = [0, 0]; ub = [Inf, d]; sol...

7 years ago | 0

| accepted

Answered
how can I plot a summation correctly?
n = 10; k = 0:n; S = cumsum(1./(k.^2+1)); plot(k,S)

7 years ago | 2

| accepted

Answered
Linear Programming With geq constraints
You will have to invert the signs of all the elements in A and b. And call linprog as xopt = linprog(z,A,b,[],[],lb) And I do...

7 years ago | 0

Answered
Optimization of Plug Flow Reactor by Varying Temperature and Pressure
Although I guess that there are bounds on P and T, here is a code that will give you a start. In case you want to constrain P ...

7 years ago | 1

| accepted

Answered
How to solve equation with elliptic integral for modulous?
Solve a_eq*sqrt(P1/B) = ellipticK(k1^2) - ellipticF(arcsin[ sin{(alpha + pi )/2}/k1],k1^2) for k1. Once you have k1, you can ...

7 years ago | 0

| accepted

Answered
Using dde23 with events option
plot(sol.x,sol.y(1,:),'k') hold on plot(sol.x,sol.y(2,:),'b') hold on plot(sol.x,sol.y(3,:),'r')

7 years ago | 2

| accepted

Answered
Using (x-a) ^ 2 + (y-b) ^ 2 = r ^ 2, the values ​​of a, b and r are known. How do I find x and y values?
theta = linspace(0,2*pi,100); x = a + r*cos(theta); y = b + r*sin(theta); plot(x,y)

7 years ago | 0

Load more