Community Profile

photo

Torsten


Last seen: Today

2 561 total contributions since 2013

Contact

Torsten's Badges

  • 36 Month Streak
  • Ace
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer

View details...

Contributions in
View by

Answered
How can I randomly extract a element in a vector?
random_element = v(randi(numel(v)))

ungefär 23 timmar ago | 0

Answered
what numerical approach is used for bvpinit?
In bvpinit, the user just specifies a guess on how the solution of the boundary value problem might look. A numerical method i...

en dag ago | 1

Answered
element wise product matrix-vector
Y_t = bsxfun(@times,Y_t,w)

3 dagar ago | 0

Answered
Unexpected output when trying to plot the solution to a system of nonlinear differential equations
Use hold on between the two plot commands.

3 dagar ago | 1

| accepted

Answered
How do I make a function work with vectors?
tanH = (exp(x)-exp(-x))./(exp(x)+exp(-x))

4 dagar ago | 0

Answered
How can I put an integral inside a for loop when the bounds depend on the loop's variable?
Phi_ij1 =@(i,j) integral2(@(y,x) B_zi(i,x,y),0,y_min1(j),0,@(y)x_max1(y,j));

5 dagar ago | 1

Answered
L2 norm of the column
M_norm = normc(M)

5 dagar ago | 0

| accepted

Answered
Curve fitting toolbox - gaussian curve to histogram with no workspace data for the y - value
I think Matlab's "mle" is what you want instead of the curve fitting toolbox.

8 dagar ago | 0

Answered
lsqnonlin and stretched exponential function
error_bounds = nlparci(x,residual,'jacobian',J) after the call to lsqnonlin. If you don't have a toolbox with nlparci, search ...

9 dagar ago | 0

Answered
I'm getting an error related to fmincon
If you mean the eigenvalue largest in magnitude, this should give you a start. Incorporating fmincon can automatize the search ...

9 dagar ago | 0

Answered
root of nonlinear equation
ft = @( c ) 0.25* ... instead of ft = 0.25* ...

10 dagar ago | 0

| accepted

Answered
stop Ode45 when y is less than a value
As defined, ode45 expects myEvent to have 2 input parameters, but you use 3. Use Opt = odeset('Events',@(t,u)myEvent(t,u,minu)...

10 dagar ago | 0

| accepted

Answered
How to add the value of the 3 highest elements automatically from a vector?
[~,idx]=maxk(y,3); y(idx)=y(idx)+sx; y

10 dagar ago | 0

Answered
Extracting values that are greater than the threshold
OxygenAlt = Alert(Alert(:,3)>21)

10 dagar ago | 0

Answered
Fitting to an intergral
Use "ArrayValued=true" as option in the call to integral.

11 dagar ago | 1

| accepted

Answered
Hello guys, I need help.
[X1,X2,X3]=ndgrid(x1,x2,x3); Z=f(X1,X2,X3); %assumes f is vectorized M=[X1,X2,X3,Z]; [~,idx]=sort(M(:,4)); sortedM=M(idx,:...

11 dagar ago | 0

Answered
Temperature ramp then keep it at constant temperature
Copy the lines where you define the global parameters to the beginning of function "fun" and remove them in the upper part of th...

11 dagar ago | 0

Answered
Best way to solve my implicit equation
Use "fzero" or "fsolve".

11 dagar ago | 1

Answered
How can i implemente this PDE system?
Use "pdepe". You will need to specify four boundary conditions for this solver, although only two for the T equation were neces...

12 dagar ago | 0

| accepted

Answered
For Loop Which Skips Numbers Based on Row Vector
Use "setdiff" to remove the row vector elements from the range of the for-loop and name the vector v. Then simply type for v ...

12 dagar ago | 0

Answered
Euler function where you can define equation, starting x and y values, number of steps and the step length
Use g = f or g = @(x,y) f(x,y) instead of g = @(x,y) f.

12 dagar ago | 0

| accepted

Answered
Integrate for a specific period of time
t=0:.01:10; x = zeros(numel(t)); x(1) = 1; fun_xdot = @(t,x) -2*(x^3) + sin(0.5*t)*x; for i = 1:numel(t)-1 x(i+1) = x(i...

7 månader ago | 0

| accepted

Answered
Why does fsolve seem not iterate towards the solution?
k = 0.1007; rZ = 12.6518; Rs = 0.164; Cmax = 7.0e-11; W = 1.704e8; iZ = 14.5273; Ls = 1.1e-7; a1 = (k/1000)^2*(rZ-Rs); ...

7 månader ago | 0

| accepted

Answered
I am getting this error "Index in position 1 is invalid. Array indices must be positive integers or logical values." Kindly help me clear this.
i and j are not defined at this line of your code ; they are first introduced one line later.

7 månader ago | 0

Answered
Finding Linear regression equation
x = [65 65 62 67 69 65 61 67]; y = [105 125 110 120 140 135 95 130]; X = [ones(numel(x),1),x.']; p = X\(y.'); b = p(1) m ...

7 månader ago | 0

Answered
Non linear least squares for a system of equations
fun = @(z)[z(1)^0.5*Ydata+z(2)-X1data,... z(1)^0.1*Ydata+z(2)-X2data,... z(1)^0.15*Ydata+z(2)-X3data]; ...

7 månader ago | 1

| accepted

Answered
How to iterate with fsolve to find Mach number
function main pt2pinf = [1.9, 2.7, 3.5, 4.3, 5.1, 5.9, 6.7, 7.5, 27.5, 47.5, 67.5 ,87.5 ,107.5,127.5, 147.5, 200, 252.5, 305,...

7 månader ago | 0

| accepted

Answered
Setting of mass matrix
options = odeset('RelTol',1e-9,'AbsTol',1e-9*ones(608,1),'Mass', @(t,y)diag([ones(1,604) sin(t) 1 1 0])); or options = odeset(...

7 månader ago | 2

Answered
How do I declare and iterate a variable in an ODE driver file?
yold = -Inf; Ssnh_in_1 = 1; [t,y]=ode15s(@(t,y)pha_cont(t,y,Ssnh_in_1),[0,15],y0); ynew = y(end,3); while yold < ynew Ssn...

7 månader ago | 0

| accepted

Answered
Ode45 solves an equation that containing a definite integral term
function main a = ...; b = ...; c = ...; d = ...; u0 = 1; usol = fzero(@(u)fun(u,a,b,c,d),u0); fun_ode = @...

7 månader ago | 1

Load more