Respondida
Computing expint(x), where x is an array, locks up for some x but not others that are very similar
The computation of the second column is even faster. I wonder how matlab evaluates expint(x) if x is a vector different from eva...

alrededor de 3 años hace | 0

Respondida
Error L2 is not defined
Since g does not depend on w and f does not depend on z, the equations are not coupled and you can do it in the following manner...

alrededor de 3 años hace | 0

Respondida
Problems in finding a set of global minima
L=1; L1=L/6; omega0 = 0; omegaR = 10; tR= (2*pi)/omegaR; te = 0.8; t1 = 0; t_i = te/50; gamma_i = 1; %alpha = (t_i^2)/...

alrededor de 3 años hace | 1

Respondida
NaN computed by model function, fitting cannot continue. Try using or tightening upper and lower bounds on coefficients.
a11 and a12 must be such that a11*C1 + a12*C2 > 0. Otherwise, the operation ^(n1-1) gives a complex result. The simplest exampl...

alrededor de 3 años hace | 0

Respondida
Skipping Iterations in a For Loop
FEM = [-16 16 -18 12 -6 6]; n = numel(FEM); for i = 1:n-3 FEM(i+1) + FEM(i) end FEM(end) + FEM(end-1)

alrededor de 3 años hace | 0

Respondida
Finding Extremum of Multivariate Functions
R(1,2)=0.7844; R(1,3)=0.7844; R(2,2)=0.6202; R(2,3)=-0.2021; R(3,3)=0.5864; x0 = 0.5*ones(10,1); lb = -1*ones(10,1); ub ...

alrededor de 3 años hace | 1

| aceptada

Respondida
Problem in solving a Fokker-Planck equation
The order of your loops is wrong. Try Nx=100;Ny=100;Nt=1000; xmin=0;xmax=3; ymin=0;ymax=3; dx=(xmax-xmin)/(Nx-1); dy=(ymax-...

alrededor de 3 años hace | 0

| aceptada

Respondida
What is the difference between "no feasible solution found" and "the problem is infeasible" messages in LSQLIN?
"No feasible solution found" means: there might be a feasible solution for your problem, but I was not able to find it. But I gi...

alrededor de 3 años hace | 1

| aceptada

Respondida
Strange temperature output for 2D heat equation
% Material properties rho=7850; Lambda=50; cp=477; alpha=Lambda/(rho*cp); % Geometry and mesh L = 0.1; nx = 10; ny = n...

alrededor de 3 años hace | 1

| aceptada

Respondida
Getting very large numbers for solutions of a system of equation
syms x y z q r theta_0 = 0; beta = 0.5; U=exp(2*i*theta_0); eqn1 = (U*beta*besselj(0,2)-1)*x + (U*beta*besselj(1,2))*y + (...

alrededor de 3 años hace | 0

| aceptada

Respondida
error in running my optimization code
I assume that "yexpected" is a matrix of size 49x3. yexpected=table2array(Book65); p0 = [3 25 25 12 1 0.5 1]; sol = lsqnonlin...

alrededor de 3 años hace | 0

Respondida
How can to compute the following case?
D = load("D.mat"); D = D.D; n = size(D,1); m = size(D,2); distance = zeros(n,m,n,m); for i=1:n for j=1:m ...

alrededor de 3 años hace | 1

| aceptada

Respondida
Plot a nx2 matrix as points
A=[0.5 2; 1.0 -0.8; 1.5 -2.5]; plot(A(:,1),A(:,2),'o')

alrededor de 3 años hace | 0

| aceptada

Respondida
Solve two equations for one variable
syms P_st vdq_st_abs Vabs delta_st Vangle Xg Q_st real eq1 = P_st - vdq_st_abs * Vabs * sin(delta_st - Vangle) / Xg == 0; eq2 ...

alrededor de 3 años hace | 0

Respondida
non linear regression problem. fitnlm gives error
Look at the values of K and B. Do you really want to approximate B by a*K^b ? format long K = load("FITDATAK.mat"); K = K.FIT...

alrededor de 3 años hace | 0

| aceptada

Respondida
Am I doing thid correct. pdepe function
x = 0:0.1:1; t = 0:0.05:0.5; m = 0; u = pdepe(m,@PDEeqn1,@initial1,@bc1,x,t); plot(x,[u(1,:);u(2,:);u(3,:);u(4,:);u(end,:)])...

alrededor de 3 años hace | 0

Respondida
How to solve coupled systems of PDEs and ODEs using method of lines
http://www.scholarpedia.org/article/Method_of_lines/example_implementation https://www.sciencedirect.com/science/article/abs/pi...

alrededor de 3 años hace | 0

Respondida
integral2 for a non-scalar matlabFunction
"intagrand_temp" is a 5x3 matrix of symbolic functions in eta and zi. I don't understand which scalar-valued function(s) you wan...

alrededor de 3 años hace | 1

Respondida
How to check the degree of parallelism
The intersection of P1 and P2 is given by x = origin1 + directions1*lambda the intersection of P1 and P3 is given by x = orig...

alrededor de 3 años hace | 1

Respondida
Hi i have created a code for adsorption process breakthrough curve following one of the examples, however i still have some orange cations around please help
You solve in q, not in qstar. Thus q=y(Nz+1:2*Nz); instead of qstar=y(Nz+1:2*Nz); Further, I doubt that qstar(i)=qm.*ks.*c...

alrededor de 3 años hace | 0

Respondida
Error with ode45 in line 89. Trying to use ode 45 to give data on a 4x4 state space matrix
M1=1; M2=1; K1=2; K2=2; B1=1; B2=1; x1_0=1; v1_0=1; x2_0=0; v2_0=1; %% equations q0=[ x1_0 v1_0 x2_0 v2_0]; dQdt = ...

alrededor de 3 años hace | 0

Respondida
How to use fminbnd but with multiple variables
In the case above, your objective function is separable in the optimization variables. Thus you can solve two independent proble...

alrededor de 3 años hace | 1

Respondida
How can I obtain all possible combinations of 3 decimals whose sum equals 1, without running into memory and space issues?
If you have some time, you can try I = 0:0.001:1. Why don't you use the code from the File Exchange ? I = 0:0.01:1; n = num...

alrededor de 3 años hace | 0

Respondida
Help creating an array with uniformly distributed random numbers (row-wise) comprised between 0 and 1, with each column having a sum of 1
https://uk.mathworks.com/matlabcentral/fileexchange/9700-random-vectors-with-fixed-sum You cannot expect the usual uniform dist...

alrededor de 3 años hace | 1

| aceptada

Respondida
How can I input sum over in function depend on time?
Never make changes in the RK4 function. Changes have to be made in the call to RK4 and in f. tstart = 0; tend = 100; dt = 0....

alrededor de 3 años hace | 0

| aceptada

Respondida
Solving stokes flow use pde toolbox
The (simplified) Navier-Stokes equations need a special numerical treatment and cannot be solved by a general-purpose code like ...

alrededor de 3 años hace | 2

Respondida
How do i fix the error that i am getting?
Remove the semicolon behind the line pivotColumns = rrefA(:,1:end-1); execute the code and see if it makes sense to insert the...

alrededor de 3 años hace | 0

| aceptada

Respondida
try to find hessian matrix
The vector of independent variables is (x1,x2,...,xn): syms i k n = 3; x = sym('x',[1 n]) f = n*log(k) - n*log(1/n*sum(x.^k)...

alrededor de 3 años hace | 0

Respondida
Integration time step in ODE45 Matlab
If you use a two-element vector for tspan only giving the start and end time of integration, the values T(i+1)-T(i) (i=1,...,end...

alrededor de 3 años hace | 0

Respondida
I am struggling to set a maximum value for a output for a function. I have nested my function in another but it is giving an error.
Instead of programming if-statements within the function routine and setting parameters depending on the actual time t, you shou...

alrededor de 3 años hace | 0

| aceptada

Cargar más