Respondida
How to run a while loop 1000 times
iter = 0; while t < T && iter < 1000 iter = iter + 1; ... end

casi 4 años hace | 1

| aceptada

Respondida
How to get u(x, t) at all positions at time t while using pdepe to solve a set of pde equations
@Qianming Yan And Z_m(u,t) is the solution of the pde system you are aiming at ? I'd suggest an iterative procedure: Solve th...

casi 4 años hace | 0

Respondida
Bi Level Optimization (solve unable to obtain explicit solution)
I couldn't test it: syms x y z t s %x y z upper level optmization variables and t s are lower levels % Upper Level Optimizatio...

casi 4 años hace | 1

Respondida
How do I use two vectors of velocity and time and a for loop to find distance?
I'd suggest vel=[10,15,17,18]; % velocity [km/h] time=[0.5,1,2,3]; % time [h] vel = [0,vel]; time = [0,time]; distan...

casi 4 años hace | 0

Respondida
calculating conditional probability in Matlab
These questions aim at exact results for the probabilities. So you must know the formulae how to calculate these probabilities....

casi 4 años hace | 0

Respondida
How to extract values at particular interval ?
A = rand(180,360,48); B = [1,5,9,13,17, 21, 25, 29, 33, 37, 41, 45]; A = A(:,:,B); size(A)

casi 4 años hace | 0

Respondida
I tried to create a mid point formula and trapezoid formula in Matlab and solve a integral using it but I'm not getting the same result as the build in function.
a = 0; b = 20; h = 1e-2; x = a:h:b; y = exp(-x.^4); x_mid = a+h/2:h:b-h/2; y_mid = exp(-x_mid.^4); format long trapz_for...

casi 4 años hace | 1

| aceptada

Respondida
calculating probability in Matlab
p = sim() 5/36 function p = sim() N = 10^3; k=0; for i=1:N p=randi(6,1,2); if sum(p)==8 k=k+1; ...

casi 4 años hace | 0

| aceptada

Respondida
How do you make a script which uses the third- order Runge- Kutta scheme to solve for y'
A class mate of yours seems to have the same problem: https://de.mathworks.com/matlabcentral/answers/1827643-function-uses-the-...

casi 4 años hace | 0

Respondida
finding probability in Matlab
You didn't define p (which should be k/1000000). But instead of 1000000, you are told to use N = 10^3 , aren't you ? And the v...

casi 4 años hace | 0

Respondida
Problem is unbounded with linprong
You solved it - f can be made as small as you like. That's what "Problem is unbounded" means.

casi 4 años hace | 1

Respondida
Solve equation using a loop
s*A*k^alpha + (1-delta)*k = k -> s*A*k^alpha - delta*k = 0 -> k*(s*A*k^(alpha-1) - delta) = 0 -> k = 0 or k = (delta/(s*A)...

casi 4 años hace | 0

Respondida
How to convert image from Cartesian to polar coordinate?
https://de.mathworks.com/matlabcentral/fileexchange/98114-cartesian-to-polar-image-transform

casi 4 años hace | 0

Respondida
I have two circles. I need to find the equation of the point of intersection at a fixed distance from points moving on each circle.
syms t x y X3 = -7 + 6*cos(9*t); %x component of first circle Y3 = -9 + 6*sin(9*t); %y component of first circle r_3 = 20; ...

casi 4 años hace | 0

| aceptada

Respondida
Index exceeds the number of array elements - water balance for euler loop
Replace for i=1:nt by for i=1:nt-1

casi 4 años hace | 0

Respondida
I get Error using zeros Size inputs must be integers when I change h to be 0.8 or larger. How can I fix that?
Better fix n instead of h: f = @(t,v) (-v*3*t)/(1+t)+2*(1+t)^3*exp(-t); a = 0; b = 15; n = 100; h = (b-a)/n; alpha =1; t=...

casi 4 años hace | 0

Respondida
How to generate matrix based on previous elements?
A= [0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 ...

casi 4 años hace | 0

| aceptada

Respondida
for loop to sum values
outDates = rand(52560,9); sums = zeros(144,1); for i=1:144 sums(i) = sum(outDates(i+(0:364)*144,6)) + sum(outDates(i+(0:3...

casi 4 años hace | 0

Respondida
Solution of a system of ODEs by means of bvp4c
Works if you start at r=1e-8 instead of r=0 (see above).

casi 4 años hace | 0

Respondida
omit rows of matrix based on a condition
B = [0.25 0 0; 0.5 -4.91 -4.9; 0.75 -4.94 -4.96; 1 -4.985 -5; 1.25 -5 -5; 1.5 -5 -5; 1.75 -5 -5]...

casi 4 años hace | 0

Respondida
How do I simplify this symbolic summation?
syms e(k) T_s n e(n) = symsum(T_s*e(k),k,[0 n]) result = simplify(e(n)-e(n-1)) % doesn't simplify result = simplify(e(20)-e...

casi 4 años hace | 0

Respondida
reverse lookup table from vector multiplikation with unknown vectors
No I got a matrix M, which is a product of two unknown vectors a and b. I want to estimate those to vectors. Sorry if i wrote i...

casi 4 años hace | 0

Respondida
Error using .* in Matlab R2014a?
Implicit expansion could be the reason. It was introduced Matlab Release 2016b. What are the sizes of "tau" and "foss_CH4_burde...

casi 4 años hace | 0

| aceptada

Respondida
How to plot equal equation at with 2 variable at each side. hard to simplift
For each value of albedo, you get 4 values for y that satisfy -900.*(1-albedo)==332.5-(y.^4).*(5.3865*10^-8)-((y-294.15)./3)-((...

casi 4 años hace | 0

Respondida
Finding Unknown Parameters from Monod Equations
Works for me. t = [0 3 5 8 9.5 11.5 14 16 18 20 25 27]' ; x = [0.0904 0.1503 0.2407 0.3864 0.5201 0.6667 0.8159 0.9979 1.0673 ...

casi 4 años hace | 0

Respondida
Newton Law - Cooling of a Cake
syms T(t) Tm k eqn = diff(T,t)==k*(T-Tm) T = dsolve(eqn) vars = symvar(T); C1 = vars(1); T = subs(T,Tm,70) eqn1 = subs(T,t...

casi 4 años hace | 1

| aceptada

Respondida
how to solve this equation in matlab??
A = [3 0 -2;-1 2 0]; b = [-4;3]; sol_inhomogen = A\b; sol_homogen = null(A); sol = @(lambda) sol_inhomogen + lambda*sol_homo...

casi 4 años hace | 0

Respondida
How can I calculate 5 lions in a row?
n = 1024; S = 0:(n-1); % 2^10 possible sequences of coin tosses. A = de2bi(S); A = [zeros(n,1),A,zeros(n,1)]; nn = 0; for i...

casi 4 años hace | 0

| aceptada

Respondida
Runge kutta method (Variable Step)?
I don't know about the correctness of the code, but it claims to use adaptive time stepping: https://de.mathworks.com/matlabcen...

casi 4 años hace | 0

| aceptada

Respondida
Problem of Symbolic function evaluation
u = sym('u',[2 1]); f = u.'*u result = subs(f,u,[1;2])

casi 4 años hace | 0

| aceptada

Cargar más