Beantwortet
I need help to make graphs please
See above. I added four lines to your code to plot the results and changed the line flux(index)=fluxp+fluxe0+fluxe1+fluxe2; to...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
The proper way to sample 3 normally or lognormal distributed variables added up to 1
You can define a common probability distribution of the three variables on the triangle x + y + z = 1, x, y, z >= 0 but this c...

mehr als 3 Jahre vor | 0

Beantwortet
How can I constrcut this matrix for a problem?
If x = [x0,x1,...,xn] is an 1x(n+1) row vector, you could use M = zeros(n+1); for i = 1:n+1 M(i,:) = psi(x(1:n+1)-x(i)); ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Are the algorithms used in mldivide direct solvers?
Are the algorithms used by "mldivide" for any input direct solvers (not matter if (not) sparse, (not) symmetric, (not) banded et...

mehr als 3 Jahre vor | 0

Beantwortet
how to write an equation the it is function of itself (solar cell current equation)
I guess you want to solve for J ? Then define fun_J = @(J) J - (J_PH - J0*(exp(q*(V+J*R_S)/(k_B*T))-1)-(V+J*R_S)/R_SH) and u...

mehr als 3 Jahre vor | 0

Beantwortet
How to write the below equation in MATLAB
R = gammainc(x/theta,k)

mehr als 3 Jahre vor | 0

Beantwortet
routing problem optimization code
https://math.stackexchange.com/questions/1658457/longest-path-with-constraint

mehr als 3 Jahre vor | 0

Beantwortet
why do I get "Array indices must be positive integers or logical values"
Most probably you mean Dnorm = Dsm./Dstd instead of Dnorm = Dsm./Dstd(D)

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
how to reduce its computing time?
Here is the code for the first loop. You can do it for the other loops in the same manner. u=[30 40 50 70]; b=u; [~,C]=size(b...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
I have to output results (z1 and z2) so the minimum value in Z1 I want to find the value in the same index in Z2, they are 4 rows and 9 columns.
%the output of the code are 2 tables z1 and z2, each consists of 4 rows and 9 coloumns, so if the the minimum value in z1 coloum...

mehr als 3 Jahre vor | 0

Beantwortet
I'm not getting any output here, can anyone please tell me what's the issue here?
for i=1:(length(time)-1) instead of for i=1:(length(t)-1)

mehr als 3 Jahre vor | 0

Beantwortet
Automating the derivation of sensitivity indices
You could use syms beta_s alpha_a alpha_u mu q_i gamma_a eta_i eta_u beta_s_num = 0.274; alpha_a_num = 0.4775; alpha_u_num =...

mehr als 3 Jahre vor | 1

Beantwortet
Pdepe: Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative.
At the moment, you set as boundary conditions du/dx + u*dv/dx = 0 at x=0 and x=1 Check whether this is really what you want. ...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
solve system of equations imposing two variables not to be equal
Solution is C1 = C2 = 1 v11 = l11, v12 = l12, v21 = l21, v22 = l22 v11 = l31, v12 = l32, v21 = l41, v22 = l42 So if l11 = l...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
hi i am trying to get the output of this loop in one matrix to use it in another function can anyone help me ?
z = acos(0.9); v = [ 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 .9 1]; % d = -z + acos(v*cos(z)) is (one) solution of (v/0.06)*tan(z)*s...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to use ODE function for modelling tanks in series
xa_in = 0.3; % inital concentration of A flowing in. xa = 1.0; % inital concentration of A in the reactor 1. tend = 15; %runti...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Doing a nested numerical integral in Matlab
mu = -20:0.01:20; f = @(mu) integral2(@(u,sigma) sin(mu*sqrt(1-sigma.^2).*cos(pi/2*u)).*(sin(mu*sigma/2)).^2,0,1,0,1); P = arr...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
The size of X must match the size of Z or the number of columns of Z.
Errors in coding and discretization have been corrected, I guess. Why did you delete your previous question ? Quite impolite in...

mehr als 3 Jahre vor | 0

Beantwortet
Solving equation with two solutions
syms M F = M*exp(-M^2/2)==0.2; vpasolve(F, [1 Inf])

mehr als 3 Jahre vor | 0

Beantwortet
how to save a matrix in each iteration in different variables
Before entering the outer loop, initialize "vol" as vol(nouter,11,4) where nouter is the number of outer loops and save the re...

mehr als 3 Jahre vor | 0

Beantwortet
How do I extract a 2-D matrix from a 3-D matrix using a row number as index
M_3d = rand(2,6,2) M_2d_1 = squeeze(M_3d(1,:,:)) M_2d_2 = squeeze(M_3d(2,:,:))

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Limiting range of a matrix
A = [1 2 3 4 5 6 7 8]; A(A<3) = 3; A(A>6) = 6; A

mehr als 3 Jahre vor | 1

Beantwortet
fsolve with vectors x and y (not x(1) x(2))
%defining constants: N_mesh=3; %define the problem for fsolve problem.objective = @(z)EquationsList(z,Nmesh); %initial poin...

mehr als 3 Jahre vor | 2

Beantwortet
I want to fit the data with the mathematical model containing numerical integration, please help me!
%AIfit.m %function par = AIFit load('GST33.mat','Expression1'); xdata = Expression1(:,1); ydata = Expression1(:,...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
[Ask Help] - Monte Carlo Coin Flip
Add the lines E = sum(coin); M = max - E; probOf0 = M / max probOf1 = E / max to your code. But your way to generate the ...

mehr als 3 Jahre vor | 0

Beantwortet
dijkstra algorithm function problem
Works for me. %--------------------------------------------------- % Dijkstra Algorithm % author : Dimas Aryo % email : mr.d...

mehr als 3 Jahre vor | 0

Beantwortet
how to calculate a double integral with simpson rule?
If your "simpson" function accepts matrix inputs for the function values on a 2d-grid in x/y direction, you might want to study ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
3-D Countour Plot based on velocity data
xyzu = readmatrix('velocity3d.txt'); x=xyzu(:,1); y=xyzu(:,2); z=xyzu(:,3); u=xyzu(:,4); F = scatteredInterpolant(x,y,z,u);...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Error using quantiz The codebook must be a real vector whose length is one more than the length of the partition. How to resolve this issue in the following code attached?
codebook = [min(C):(max(C)-min(C))/2^n:max(C)]; instead of codebook = [min(C):(max(C)-min(C)/2^n):max(C)];

mehr als 3 Jahre vor | 0

Beantwortet
Why quadprog fvalue3 & fmincon fvalue1 are not same in the example below?
Should be H = double(hessian(Rtot,X)); instead of H = 0.5*double(hessian(Rtot,X)); since Rtot(x) = Rtot(0) + f.'*x + 0.5*x...

mehr als 3 Jahre vor | 1

| akzeptiert

Mehr laden