Community Profile

photo

Torsten


Last seen: 1 día hace Con actividad desde 2013

Estadísticas

  • Most Accepted 2022
  • Explorer
  • Master
  • 36 Month Streak
  • Revival Level 2
  • Knowledgeable Level 5
  • First Answer

Ver insignias

Content Feed

Ver por

Respondida
trying to create a plot of cost per mile when the trailer weight increases in a program I wrote and i cannot get it to work.
%for plot clear clc F='diesel';%input('gasoline or Diesel: ','s'); C=6;%input('number of engine cylinders '); T='yes';%inpu...

alrededor de 13 horas hace | 0

Respondida
Plotting the integral of a graph using cumtrapz.
Then my guess is that some of the x-values (maybe starting around 60) are NaN values. Remove them before applying "cumtrapz".

alrededor de 14 horas hace | 2

Respondida
Loop: for i = 1:L ;
because i got the task to do it like that and not to use: data(:,i+1) = data(:,i) * p. Then use for i = 2:L

alrededor de 23 horas hace | 0

Respondida
Accelerate a loop involving the built-in integral command
You will have to reorder the "Output" array, but I think the code should be faster. my_fun = @(t,param) t.^2; T = 2; omega = ...

1 día hace | 0

Respondida
Why am i getting this error>>>Index exceeds the number of array elements (1). Error in Boom (line 38) Y(t) = X_best_so_far(t-1); % Use X_best_so_far value for the
As you correctly write in your code, the line X_best_so_far = X_best_so_far(1); % Initialize X_best_so_far as a scalar sets X_...

2 días hace | 0

Respondida
Using Matlab to solve 1D Schrödinger Equation (Strange Eigenfunctions)
N = 2000; dy = 1/N; y = linspace(0,1,N+1).'; mL2V = @(y)1000*(y-0.5).^2; e = -1/(2*dy^2)*ones(N-1,1); d = 1/dy^2 + mL2V(y(2...

3 días hace | 1

| aceptada

Respondida
Numerically solve a 3rd order differential equation with 3 unknowns
Use "gradient" three times to get approximations for y', y'' and y''' in the points of your t-vector. Let diff_y, diff_y2, diff...

3 días hace | 0

| aceptada

Respondida
How to plot a continuous graph as shown in the below graph?
t1 = [1 6]; y1 = [1 1]; t2 = [6 7]; y2 = [0.45 0.45]; t3 = [7 8]; y3 = [1 1]; t4 = [8 9]; y4 = [0.4 0.4]; t5 = [9 11]; y5 = ...

3 días hace | 1

Respondida
Storing parameters from a for loop in arrays
t = [0:0.2:3].'; y = [3.43101641262231;-0.527550212558249;3.43697613505530;0.186721377613475;5.11301585254667; 6.786264197...

3 días hace | 0

Respondida
how can improve my code performanece, it uses a syms vector, i tried to delete y=t= sym(zeros(1, m + 3)); and it's faster but the solution of the function its wrong
You can't use t(k), t(k+1), t(k+2), y(k), y(k+1) and y(k+2) to define y(k). The values for these y's and t's are not yet known. ...

3 días hace | 0

Respondida
error in for loop
I substituted 1/sqrt(x) by y in your equation. As you can see, there are only negative solutions such that resubstituting gives ...

4 días hace | 0

Respondida
Why the nonlinear least square fitted curve is not a curve?
Why do you think the red line is not a curve ? For this point cloud of experimental data, I think the red line is the best you ...

4 días hace | 0

Respondida
Sorting a matrix according to another one
A = [11 0.001 3 11 0.001 4 12 0.003 5 9 0.002 6 8 0.000 7 10 0.004 8 8 0.000 9 9 0...

4 días hace | 0

| aceptada

Respondida
Lower Dirichlet boundary condition for heat equation PDE
Your equations are not suited to be solved with pdepe. Both contain no second derivatives in space which is necessary for an eq...

4 días hace | 0

Respondida
plot between two variables
Use plot(1:365,[PR;ones(1,365)*PR_ave]); instead of plot(PR,PR_ave); if PR is a row vector, or plot((1:365).',[PR,ones(365...

4 días hace | 0

Respondida
vpa solving 5 equations with 5 unknowns, but result is an empty structure
Did you read somewhere that "vpasolve" can handle inequalities ? Anyway, it seems the problem is too hard for a symbolic soluti...

4 días hace | 0

Respondida
Second time derivative of ODE45 solution looks bumpy
t=[0 5]; initz=[0; 0]; [t,z]=ode15s(@f3, t, initz, odeset('RelTol',1e-12,'AbsTol',1e-12)); for i=1:numel(t) dz = f3(t(i),z...

5 días hace | 0

| aceptada

Respondida
How to plot the first derivative of solution?
Piecewise1111copy() function Piecewise1111copy x1=1; u=3; teta=zeros(3,1); teta(1)=0; for i=1:3 teta(i+1)=2*i; end ...

5 días hace | 0

Respondida
How can I fit the parameters using mle with a self-defined function?
Works for me (see above).

5 días hace | 1

| aceptada

Respondida
Error in my MATLAB code
Explicitly listing the sizes of the matrices involved (see above), I come to the conclusion that yd(t) must be a 4x1 column vect...

5 días hace | 1

Respondida
Solving equations with parameters and then inputting different values
Try a solution with c, k, m, x0 and v0 being symbolic variables. Then you only need to "subs" the numerical values for the para...

5 días hace | 0

| aceptada

Respondida
How i can evaluate characteristic function for a random normal vector
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ChF of X(w) K-dimensional normal(MU,SIGMA) % % X real stochas...

5 días hace | 0

| aceptada

Respondida
Fsolve produces comlex numbers
The usual reasons why solvers like "fsolve" produce complex numbers are: you take the square-root of a negative number (sqrt(x)...

6 días hace | 0

Respondida
When I run my code, I keep getting this error: "Undefined function or variable 'y'."
syms t y(t) syms s real m = 0.05; Dy = diff(y,t); D2y = diff(y,t,2); D3y = diff(y,t,3); eqn = D3y -( -3/m*D2y + 1/m^2*(1-...

6 días hace | 0

Respondida
How can we define the initial conditions u0 at time t+1 as a vector that is equal to the previous initial conditions u0 at time t?
In order to proceed, I need to assign the initial conditions u0 at time t+1 to be equal to the previous initial conditions u0 at...

6 días hace | 0

Respondida
Hi guys, my code doesn't run i couldn't debug this, could you anyone help me?
When you call "calculate_G11_imag", "f "has size 1x2 and "gamma" has size 1x3. Thus f .* gamma is not defined and sum(f .* gamma...

6 días hace | 0

Respondida
Warning: Imaginary parts of complex X and/or Y arguments ignored. > In Finalv3test (line 19) Warning: Imaginary parts of complex X and/or Y arguments ignored. > In Finalv3t
(abs(VGSoff) / VP) is negative, thus (abs(VGSoff) / VP)^sqrt(2) produces complex numbers. Thus ID1 and ID2 are complex-va...

6 días hace | 0

Respondida
Discrete, time varying Dirichlet boundary conditions for heat equation in pdepe
L = 29; x = [0:1:L]; t = [0:1:15]; m = 0; uUpper = trimmedTempData(1,1:16); uLower = trimmedTempData(end,1:16); t0 = trimm...

6 días hace | 0

| aceptada

Respondida
Predicting the value at y(t=8) using my model
thetaL(1)*8 + thetaL(2)

6 días hace | 0

Respondida
how to plot a summation function in matlab using a for loop
For reference: syms k t f(t) = 4*symsum((-1)^(k+1)*cos(k*t)/k^2,k,1,Inf) f(0) fplot(f+2/3*pi^2,[-2*pi,2*pi])

7 días hace | 0

Cargar más