Answered
sol = bvp4c (OdeBVP, OdeBC, solinit, options);
function slipflow format long g %Define all parameters % Boundary layer thickness & stepsize etaMin = 0; etaMax1 = 15; eta...

4 years ago | 1

| accepted

Answered
How to solve coupled odes with two time dependent variables with ode45?
function dy = odfun(t,y,Kl,qm,Keq,R,T,n,rhop,eps) q = y(1); c = y(2); dy(1) = Kl*((qm*Keq*c*R*T/(1+(Keq*c*R*T)^n)^(1/n)...

4 years ago | 1

| accepted

Answered
Difficulty solving simple implicit equation
Imin = ...; Imax = ...; a = ...; R = ...; V = array of values L = array of values fun = @(Im,V,L) Im - ((Imax-Imin).*L +Im...

4 years ago | 0

| accepted

Answered
How to use for loop when have syms inside the loop
Try syms t x(t) Xmax = 1410.34; conc = [50 100 150]*1e-9; ka ...

4 years ago | 0

Answered
Not able to solve fzero with array by for-loop
To see where the problem with fzero is, I suggest you first plot your function for a reasonable value of lambdaCH_030_4h: c_int...

4 years ago | 1

Answered
How to solve coupled partial differential equations with method of lines?
The sink term - (((1-eps)*rhop)/eps)*dqdt(i); for the concentration of your gaseous species is always 0 because you specify d...

4 years ago | 0

Answered
How to plot the results from dsolve matlab
Rmax = 1410.34; conc = 500e-9; ka = 3.46e3; kd = 1.46e-4;...

4 years ago | 0

| accepted

Answered
getting error in for loop
Loop indices don't start at 0, but at 1 in MATLAB: for i=1:length(Vds) Idsat(i)=r1*(Vgs-(r2)+Vds(i)); end instead of fo...

4 years ago | 0

Answered
How to correct the code?
gb=3;gs=8; ES=4.5;is=20;EB=1.5;ib=40; b=8;s=3;Ns=1;Nb=1; Esl=@(s)(ES)-(is/s)+Ns Eby=@(b)(ib/b)-(EB)-Nb f = @(s,b)(b*Eby(b)-...

4 years ago | 0

Answered
How to find the eigenvector associated with the highest eigenvalues.
Why not just trying whether A*x equals lambda_max*x within a certain tolerance ?

4 years ago | 0

Answered
Index in position 3 exceeds array bounds (must not exceed 80000).
keepgoing = true; for k=1:79999 % This line was k=1:p normally too instead of keepgoing = true; for k=1:80000 % This line wa...

4 years ago | 0

| accepted

Answered
calculation of a derivative writing a function
Your function does not have local maxima or minima in terms of theta0. If theta0 is restricted to an interval [theta0min,theta0...

4 years ago | 0

Answered
Setting up linear optimization problem
Since your vectors X and Y are of moderate size, don't use an optimization tool. I think it's best t...

4 years ago | 0

Answered
How to save dydt(3) equation computed inside ODE?
[t,y] = ode45(@(t,y) odefcn(t,y), [0 T_f], zeros(1,3)) ; dydt = zeros(size(y)); for i = 1:numel(t) dydt(i,:) = odefcn(t(i...

4 years ago | 0

Answered
how to take a value from multiple arrays defined from an expression.
for each row i found the max value between 7 arrays with a for cycle If you found the max value, you also found whether A/H,B/I...

4 years ago | 0

Answered
3D Polar Plot
a = 1.0; sigma = 2.0; r = 0.2:0.001:3; phi = 0:pi/100:2*pi; [R,PHI] = meshgrid(r,phi); X = R.*cos(PHI); Y = R.*sin(PHI); ...

4 years ago | 0

| accepted

Answered
Not having Integration result
Using "int", MATLAB tries to find an analytical antiderivative for your function, but cannot find one. Use numerical integraion...

4 years ago | 0

| accepted

Answered
how to write partial derivatives in MATLAB
Maybe https://de.mathworks.com/help/symbolic/sym.jacobian.html ?

4 years ago | 0

| accepted

Answered
How to plot x^2+y^2=<1 and to be upper the Ox ?
p = nsidedpoly(1000, 'Center', [0 0], 'Radius', 1); plot(p, 'FaceColor', 'r') axis equal

4 years ago | 0

Answered
Plotting arrays of same length
y_picchi = interp1(time,y,tempo_picchi); plot(tempo_picchi,y_picchi)

4 years ago | 0

Answered
How to determine coefficients by fit for multiple series of data?
x = [2,4,6,NaN,NaN; 2,4,6,8,10; 2,4,6,8,NaN]; y = [3,5,7,NaN,NaN; 4,8,11,25,32; 7,10,15,17,NaN]; D = [3;5;7]; N = size(x, 1);...

4 years ago | 0

| accepted

Answered
randomly choose an element from each row in a matrix if it was equal to one
You mean D= [1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 ...

4 years ago | 0

Answered
Is it possible to use Matlab to get expressions for the coefficients in polynomial regression? (I.e., not just constant coefficients)
M = [X.^(-1).*Y,X.^(-1).*Y.^2,Y.^2,X.*Y.^2,X.^(-1).*Y.^3,X.*Y.^3,X.^2.*Y.^3,X.^(-2).*Y.^4,X.^(-1).*Y.^4,Y.^4]; b = PHI - 1.0; ...

4 years ago | 0

| accepted

Answered
How to numerically integrate with variable bounds
gmin = 2; gmax = 6; p = 2.5; inner = @(x,g) x*integral(@(z)besselk(5/3,z),x/g^2,Inf); fun = @(x)integral(@(g)g^(-p)*inner(x,...

4 years ago | 0

Answered
How to linear fit two y variables in same plot?
Choose X = [x1,x2], Y = [y1,y2] as data to be fitted.

4 years ago | 0

Answered
where are the errors in my code? please help me!!
syms r z eqn = ((z+1/z)/2)^2 == 5/16*r; S = solve(eqn,z); y = log(S)*0.5/10^10 solves the equation (cosh(10^10.*y./0.5)).^2...

4 years ago | 0

| accepted

Answered
Getting Chi-Squared Statistic
chi2inv(0.95,1) % gives 3.8415 chi2cdf(3.8415,1) % gives 0.95

4 years ago | 0

| accepted

Answered
Not able to find fzero
d1=20; n=10^-11.4; m=2.7; a=0.5; T=1; PsByN_0dB=5; PsByN_0=10.^(PsByN...

4 years ago | 1

| accepted

Answered
Convert plot to curve
For w <= 0.59, you get (Emax,Tmax) = (27.631,55.2), for w>=0.6, you get (Emax,Tmax) = (0.075959,94.949). This gives two poin...

4 years ago | 0

| accepted

Answered
How to create a matrix with special block diagonal structure
ntriangles = 4; n = ntriangles*(ntriangles+1)/2; A = zeros(n); rowstart = 1; rowend = 1; for i = 1:ntriangles for jrow...

4 years ago | 0

Load more