Answered

how to write matlab code

N=20:50 A = setdiff(N,N(mod(N,4)==0 & mod(N,5)==0))

how to write matlab code

N=20:50 A = setdiff(N,N(mod(N,4)==0 & mod(N,5)==0))

17 jours ago | 0

Answered

Partial Differential Equation Toolbox

Take c = [- x, x - y ; - ( x - y ), - y] Then -div(c*grad(u)) = x * d^2u/dx^2 + y * d^2u/dy^2 Section 2-62 in http://www....

Partial Differential Equation Toolbox

Take c = [- x, x - y ; - ( x - y ), - y] Then -div(c*grad(u)) = x * d^2u/dx^2 + y * d^2u/dy^2 Section 2-62 in http://www....

18 jours ago | 1

| accepted

Answered

Solving for two uknown vectors in a matrix equation

syms t1 t2 s1 s2 s3 [solt1 solt2 sols1 sols2 sols3] = solve([N*[t1;t2]+R*[s1;s2;s3] == x],[t1 t2 s1 s2 s3])

Solving for two uknown vectors in a matrix equation

syms t1 t2 s1 s2 s3 [solt1 solt2 sols1 sols2 sols3] = solve([N*[t1;t2]+R*[s1;s2;s3] == x],[t1 t2 s1 s2 s3])

18 jours ago | 0

Answered

Question about Taylor series

d(1) = cos(a), d(2) = -sin(a), d(3) = -cos(a), d(4) = sin(a) So your if-statement to determine f^(n)(a) is wrong. Further, "er...

Question about Taylor series

d(1) = cos(a), d(2) = -sin(a), d(3) = -cos(a), d(4) = sin(a) So your if-statement to determine f^(n)(a) is wrong. Further, "er...

18 jours ago | 0

Answered

solving an implicit function with two variables

Multiply by P^r and substitute P^r = x. You'll get a quadratic equation in x. Solutions are P1 = ( (Q^(-r)) / 2 * (1 + sqrt(1 ...

solving an implicit function with two variables

Multiply by P^r and substitute P^r = x. You'll get a quadratic equation in x. Solutions are P1 = ( (Q^(-r)) / 2 * (1 + sqrt(1 ...

18 jours ago | 1

| accepted

Answered

Standard Deviation of product of two Gaussian Distribution.

https://math.stackexchange.com/questions/1416518/standard-deviation-of-the-product-of-gaussians

Standard Deviation of product of two Gaussian Distribution.

https://math.stackexchange.com/questions/1416518/standard-deviation-of-the-product-of-gaussians

19 jours ago | 2

| accepted

Answered

Solving compound linear optimization problem

Look up https://de.mathworks.com/discovery/multiobjective-optimization.html

Solving compound linear optimization problem

Look up https://de.mathworks.com/discovery/multiobjective-optimization.html

19 jours ago | 0

Answered

How do I solve for the upper bound of a definite integral when I know what the integral is equal to?

a1=...; a2=...; w=...; xo=...; value_integral=...; sol = fzero(@(C)((integral(@(x)1./(a1*sin(w*x)+a2*sin(3*w*x)))-value_int...

How do I solve for the upper bound of a definite integral when I know what the integral is equal to?

a1=...; a2=...; w=...; xo=...; value_integral=...; sol = fzero(@(C)((integral(@(x)1./(a1*sin(w*x)+a2*sin(3*w*x)))-value_int...

19 jours ago | 1

Answered

Pseudo-random distribution of points with minimum distance

See Bruno Luong's code under https://de.mathworks.com/matlabcentral/answers/432516-model-of-a-crowd-on-concert-venue-or-how-to-...

Pseudo-random distribution of points with minimum distance

See Bruno Luong's code under https://de.mathworks.com/matlabcentral/answers/432516-model-of-a-crowd-on-concert-venue-or-how-to-...

22 jours ago | 0

| accepted

Answered

Last Tableau of Simplex Method in LP Problem

https://www.12000.org/my_notes/simplex/index.htm

Last Tableau of Simplex Method in LP Problem

https://www.12000.org/my_notes/simplex/index.htm

22 jours ago | 0

| accepted

Answered

Error in ode function -- not enough input arguments

Change these lines: dEc2adt = @(t, Ec,Tc) (-alfa.*Ek2a(t))./Tc - Ec./Tc; [t2a Ec2a] = ode15s(@(t,Ec)dEc2adt(t, Ec,Tc), t2a, ...

Error in ode function -- not enough input arguments

Change these lines: dEc2adt = @(t, Ec,Tc) (-alfa.*Ek2a(t))./Tc - Ec./Tc; [t2a Ec2a] = ode15s(@(t,Ec)dEc2adt(t, Ec,Tc), t2a, ...

23 jours ago | 1

| accepted

Answered

Solvin Differential Algebraic Equations

function main %gaslift systems network tspan = [0:1:60]; % The script for gas lift network model defining initial condi...

Solvin Differential Algebraic Equations

function main %gaslift systems network tspan = [0:1:60]; % The script for gas lift network model defining initial condi...

23 jours ago | 0

| accepted

Answered

Problems with numerical integration with 2 variables

function main Result = integral(@fun,0,pi/2) end function funret = fun(theta) n = numel(theta); funret = zeros(n,1)...

Problems with numerical integration with 2 variables

function main Result = integral(@fun,0,pi/2) end function funret = fun(theta) n = numel(theta); funret = zeros(n,1)...

25 jours ago | 0

| accepted

Answered

How do you get ten random values between -pi/2 and pi/2

theta = -pi/2 + rand(10,1)*pi

How do you get ten random values between -pi/2 and pi/2

theta = -pi/2 + rand(10,1)*pi

25 jours ago | 0

Answered

How do I differentiate this function?

syms Z K gamma eta alpha NRC EOS1 v X R EOS2 NRM Y= Z*K^gamma*((1-eta)*((1-alpha)*NRC^EOS1+alpha*(X^v+R^v)^(EOS1/v))^(EOS2/EOS...

How do I differentiate this function?

syms Z K gamma eta alpha NRC EOS1 v X R EOS2 NRM Y= Z*K^gamma*((1-eta)*((1-alpha)*NRC^EOS1+alpha*(X^v+R^v)^(EOS1/v))^(EOS2/EOS...

25 jours ago | 0

| accepted

Answered

Tensor product of three matrices

M = kron(A,kron(B,C)) or M = kron(kron(A,B),C)

Tensor product of three matrices

M = kron(A,kron(B,C)) or M = kron(kron(A,B),C)

25 jours ago | 1

| accepted

Answered

How do I assign part of a matrix to be a variable

A1 = A(1:3,:); A2 = A(4:6,:); A3 = A(7:9,:);

How do I assign part of a matrix to be a variable

A1 = A(1:3,:); A2 = A(4:6,:); A3 = A(7:9,:);

26 jours ago | 0

Answered

Solving partial differential system

s= [-v*DuDx(1)-psi*km*(qe-u(2)); km*(qe-u(2))]; function [pl,ql,pr,qr] = pdex4bc(xl,ul,xr,ur,t) Q=2.5; %mL min^-1 A_c=1.96e...

Solving partial differential system

s= [-v*DuDx(1)-psi*km*(qe-u(2)); km*(qe-u(2))]; function [pl,ql,pr,qr] = pdex4bc(xl,ul,xr,ur,t) Q=2.5; %mL min^-1 A_c=1.96e...

26 jours ago | 1

| accepted

Answered

I need matlab code for cot(x) Taylor Polynomial Function

f = @(x)cot(x); a = 5*pi/8; P0 = @(x)f(a)*ones(size(x)); P1 = @(x)f(a)+(- f(a).^2 - 1).*(x-a); P2 = @(x) f(a)+(- f(a).^2 -...

I need matlab code for cot(x) Taylor Polynomial Function

f = @(x)cot(x); a = 5*pi/8; P0 = @(x)f(a)*ones(size(x)); P1 = @(x)f(a)+(- f(a).^2 - 1).*(x-a); P2 = @(x) f(a)+(- f(a).^2 -...

26 jours ago | 0

Answered

Integro-differential systems

Solve d(psi)/dt = x(t), psi(0)=0 dx/dt = psi(t) - x(t), x(0) = ? Best wishes Torsten.

Integro-differential systems

Solve d(psi)/dt = x(t), psi(0)=0 dx/dt = psi(t) - x(t), x(0) = ? Best wishes Torsten.

26 jours ago | 1

Answered

PDEPE boundary condition outputting odd results.

function main m = 0; tspan = linspace(0,365*20*86400,21); xmesh = linspace(0,20,201); sol = pdepe(m,@pdefun,@icfun,...

PDEPE boundary condition outputting odd results.

function main m = 0; tspan = linspace(0,365*20*86400,21); xmesh = linspace(0,20,201); sol = pdepe(m,@pdefun,@icfun,...

29 jours ago | 0

| accepted

Answered

Need help with the integral

format long I = 0.0; Iexact = 0.904524237900272; eps = 1e-15; n = 0; while abs(I-Iexact) > eps I = I + (-1)^n/(factorial(...

Need help with the integral

format long I = 0.0; Iexact = 0.904524237900272; eps = 1e-15; n = 0; while abs(I-Iexact) > eps I = I + (-1)^n/(factorial(...

29 jours ago | 0

| accepted

Answered

Generate random number from a two-parameter exponential distribution

gam = ...; lambda = ...; n = 100; x = gam - log(1-rand(n,1))/lambda give you 100 random numbers distributed according to you...

Generate random number from a two-parameter exponential distribution

gam = ...; lambda = ...; n = 100; x = gam - log(1-rand(n,1))/lambda give you 100 random numbers distributed according to you...

30 jours ago | 0

| accepted

Answered

how to run optimisation problem

Use fmincon with objective function f = @(x)(R'*x)/sqrt(x'*sigma*x) and linear constraint Aeq = ones(size(x)) beq = 1 Best...

how to run optimisation problem

Use fmincon with objective function f = @(x)(R'*x)/sqrt(x'*sigma*x) and linear constraint Aeq = ones(size(x)) beq = 1 Best...

30 jours ago | 0

Answered

How to take the fourth derivative of a reflectance graph

If you have the signal processing toolbox licenced, use "sgolay" and "sgolayfilt". Or download from the file exchange: https:/...

How to take the fourth derivative of a reflectance graph

If you have the signal processing toolbox licenced, use "sgolay" and "sgolayfilt". Or download from the file exchange: https:/...

30 jours ago | 0

| accepted

Answered

Saving all the variables from an ode45 Function

[tw1,yw1] = ode45('Newscript_VectorField',Timet1,Ic1,options) w = yw(:,1)*Yi11 + yw(:,2)*Yi12

Saving all the variables from an ode45 Function

[tw1,yw1] = ode45('Newscript_VectorField',Timet1,Ic1,options) w = yw(:,1)*Yi11 + yw(:,2)*Yi12

environ un mois ago | 1

Answered

How to automatically constrain some of the unknown values in an optimization problem?

If you know in advance which elements of the x-vector are grouped together, you can simply use Aeq and beq to define the equalit...

How to automatically constrain some of the unknown values in an optimization problem?

If you know in advance which elements of the x-vector are grouped together, you can simply use Aeq and beq to define the equalit...

environ un mois ago | 1

| accepted

Answered

Too many input arguments - Fminsearch

function fmin x0=0; %parâmetro de valor inicial para a condição options=optimset('Display','iter','TolFun',0.1) [x]=fmi...

Too many input arguments - Fminsearch

function fmin x0=0; %parâmetro de valor inicial para a condição options=optimset('Display','iter','TolFun',0.1) [x]=fmi...

environ un mois ago | 0

Answered

Error in while loop

Do you want a different value for B for each minor, i.e. B(i) instead of B ? Then use function IsStable(polynomial) if AllNon...

Error in while loop

Do you want a different value for B for each minor, i.e. B(i) instead of B ? Then use function IsStable(polynomial) if AllNon...

environ un mois ago | 1

| accepted

Answered

Combining vectors [1 2 3 4 5] and [2 3 4 1 5] to [12 23 34 41 55]

v = 10*v1 + v2

Combining vectors [1 2 3 4 5] and [2 3 4 1 5] to [12 23 34 41 55]

v = 10*v1 + v2

environ un mois ago | 0

| accepted