Answered
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 0-by-1.
rand(-1,1) tries to create a matrix of uniformly distributed random variables on [0,1] with dimensions -1 and 1. A negative matr...

3 years ago | 0

Answered
How to calculate empirical cumulative distribution function of a dataset? If I use ecdf function then why the number of datapoints are decreasing? Is there any other formula?
If I use ecdf function then why the number of datapoints (the matrix f1 becomes (1564x1) and x1 becomes(1564x1) matrix) are decr...

3 years ago | 0

Answered
Hello folks, I need help regarding visualization of solutions for a transient thermal analysis done using PDE solver on a 3D geometry.
ad 1) Face 2 is an internal boundary. You don't need to set a boundary condition on it. The internal boundary condition is T_le...

3 years ago | 0

Answered
Nonlinear overdetermined equation systems
By using "lsqnonlin", e.g. sol0 = [0 0 0 0]; sol = lsqnonlin(@fun,sol0) norm(fun(sol)) function res = fun(u); x = u(1);...

3 years ago | 0

Answered
can anyone help me about Error using optim.problemdef.OptimizationProblem/solve Invalid argument at position 2. Value must be finite.
Above your error - written out more clearly so that you as the coder should be able to understand the problem. In nodestr=dec...

3 years ago | 0

| accepted

Answered
Problem to solve nonlinear Eq. with Newton's Method
i=sqrt(-1); n1=1; n3=1.515; lambda=632.8; %nm alpha0=-deg2rad([50 55 60]); teta1=deg2rad(50); phi0 =deg2rad([75.357 68...

3 years ago | 0

Answered
How to plot two concentric spheres with radius1=1 and radius2 =10 in MATLAB and filled with fluid flow (I have one velocity component only)
lambda=1.5; eta=1; beta1=10;beta2=10; alpha=.00001; eta1=0.0;w=0.1;k=(1/eta.^2).^(0.5); a=1; % w=w2/w1 alpha1=((k.^2+(k....

3 years ago | 1

| accepted

Answered
How to plot two concentric spheres with radius1=1 and radius2 =10 in MATLAB and filled with fluid flow (I have one velocity component only)
I'm surprised that velocity increases with growing r. Continuity equation should force velocity to decrease. But maybe my parame...

3 years ago | 0

Answered
levenberg-marquardt with linear constraints
x = lsqnonlin(fun,x0,lb,ub,A,b,Aeq,beq,nonlcon) A,b,Aeq,beq define the linear constraints.

3 years ago | 2

Answered
measurement based optimization using fmincon
"fmincon" is not a stochastic, but a deterministic optimizer. You are not allowed to use random inputs for it that change every ...

3 years ago | 0

| accepted

Answered
Error: Limits of integration must be double or single scalars. While solving equations numerically with symbolic integral limits
I guess this is what you mean. initial_guess = [0.5, 0.1, 2]; % Use fsolve to solve the equation system result = fsolve(@(var...

3 years ago | 1

| accepted

Answered
nonconformant arguments (op1 is 1x1, op2 is 0x0)?
Works for me (see above). Although the solver doesn't seem to be successful. You forgot to include the "global" line in the scr...

3 years ago | 1

| accepted

Answered
Get the same value when using Integral2 function
As I already tried to explain, v_induced and v_slipstream are only formal parameters for the integral2 function. They cannot tra...

3 years ago | 0

| accepted

Answered
Adding 2D array to 3D array within loop
totalarray = rand(365,721,1440); newdata = rand(721,1440); squeeze(totalarray(1,:,:)) newdata for i = 1:365 totalarray(...

3 years ago | 0

| accepted

Answered
the value i am calling for from a matrix isnt changing although index is changing
You forgot to reset e to 1 after the while-loop.

3 years ago | 0

| accepted

Answered
Error of "Integrand output size does not match the input size."
As written, Oper.rho .* (v_induced ./ Oper.Vinf) .* 0.5 .* (Oper.Vinf^2 - (v_induced .^2)); and Oper.rho .* (v_slipstream ./ ...

3 years ago | 1

Answered
Not able to get real solution through syst solve
Always plot the functions before solving for common points and set initial values for the variables according to what you see in...

3 years ago | 0

Answered
Fixed bed adsorption using pore diffusion model
The "dq/dt" in equation 2 is the change of mass of q in the particle with respect to time. If you set q_in_particle = integral_...

3 years ago | 0

| accepted

Answered
Solve integral equation efficiently
nu = 1.04 * 10^(-6); %m2/s Aplus = 26; kappa = 0.41; z = 0.3; meanU = 4.3556e-04; fun = @(x) 2 ./ ( 1 + sqrt( 1 + 4 * kap...

3 years ago | 1

| accepted

Answered
How to use a sparse Jacobian for a stiff ODE solver to avoid the error "array exceeds maximum array size preference"
Here is an example code how to create the sparsity pattern for a given (quite complicated) ODE function. Use the function "S_pa...

3 years ago | 0

Answered
How to use "deval" or any other function non ode solver output
Y_exact_to_Y = interp1(T_exact,Y_exact,tout) where T_exact is the vector of time points corresponding to Y_exact. Further, you...

3 years ago | 0

| accepted

Answered
How to Solve PDE numerically that gives boundary condition on function at one end and on slope of function at other end?
a = 1; p = 1; w = 1; r0 = 0.5; rstart = 0; rend = 1; nr = 50; zstart = 0; zend = 1; nz = 50; ...

3 years ago | 1

| accepted

Answered
How can I solve the differential equation whose variables are y"(i), y"(i+1)?
Use dde23. But often, such dependencies of the ODE from the results of the last time step stem from a discretization of the dif...

3 years ago | 0

Answered
Maximizing Batch Reactor Products in matlab
You get almost identical values for the optimal T, C_M and C_TEA for all x-values in between 17 and 45 as you can see after the ...

3 years ago | 1

| accepted

Answered
Using a symsum inside a fsolve
If I understood correctly, I would have to run a Symsum "nested" inside the fsolve. Is that correct? How do I implement this? ...

3 years ago | 0

Answered
Maximizing Batch Reactor Products in matlab
max_value = -Inf; T_array = linspace(338.15,368.15,10); C_M_array = linspace(1,100,10); C_TEA_array = linspace(1,200,10); C_...

3 years ago | 0

Answered
How to Interpolate an entire data set
I think you interchanged latitude and longitude in your call. It should be Anew= F(-6.00,52.00); instead of Anew= F(52.00,-6....

3 years ago | 0

Answered
Which triangulation Method is used for natural scattered interpolation?
Taken from https://uk.mathworks.com/help/matlab/ref/scatteredinterpolant.html Algorithms scatteredInterpolant uses a Delaunay...

3 years ago | 0

Answered
Why is it detecting 2 centroids in 1 object?
Are you sure you included the correct image file ? I = load("labelstemp.mat"); I = I.labelstemp; size(I,1)*size(I,2) nnz(I(:...

3 years ago | 0

Answered
Indexing nearest value to my coordinate
lon_data = rand(621,837); lat_data = rand(621,837); stations = rand(59,2); lon_indices = zeros(59, 1); lat_indices = zeros(5...

3 years ago | 0

| accepted

Load more