Answered

How do I write an inductive sequence?

N = 10; % define number of recurrence terms to be calculated x = zeros(N,1); x(1)...

How do I write an inductive sequence?

N = 10; % define number of recurrence terms to be calculated x = zeros(N,1); x(1)...

6 mois ago | 1

| accepted

Answered

substract array elements based on other arrays

setdiff(All,union(R1,R2))

substract array elements based on other arrays

setdiff(All,union(R1,R2))

6 mois ago | 1

| accepted

Answered

Solving large sparse Ax=b with lower bound constraint

Did you try starting from the solution of the unconstraint problem ?

Solving large sparse Ax=b with lower bound constraint

Did you try starting from the solution of the unconstraint problem ?

6 mois ago | 0

| accepted

Answered

dsolve second order differential equation

dySol=diff(ySol,x); dySol(585.8)

dsolve second order differential equation

dySol=diff(ySol,x); dySol(585.8)

6 mois ago | 0

| accepted

Answered

How to plot graph of value of variable when a parameter is varied

Your equations can only be solved for one value of R, namely R = 0.3 + 0.366*exp(-0.3). This can be seen by dividing equation 1...

How to plot graph of value of variable when a parameter is varied

Your equations can only be solved for one value of R, namely R = 0.3 + 0.366*exp(-0.3). This can be seen by dividing equation 1...

6 mois ago | 0

Answered

write a function called tri_area returns the area of a triangle with base b and height h

function area = tri_area(b,h) area = 0.5*b*h; end From the command window A = tri_area(3,2)

write a function called tri_area returns the area of a triangle with base b and height h

function area = tri_area(b,h) area = 0.5*b*h; end From the command window A = tri_area(3,2)

6 mois ago | 2

| accepted

Answered

Finite Difference Method to find Steady State

T = zeros(6,5); T(1:6,1) = 10; T(1:6,5) = 50; T(1,2) = 73; T(1,3) = 100; T(1,4) = 85; for n=1:5 for i =2:4 T(n+1,...

Finite Difference Method to find Steady State

T = zeros(6,5); T(1:6,1) = 10; T(1:6,5) = 50; T(1,2) = 73; T(1,3) = 100; T(1,4) = 85; for n=1:5 for i =2:4 T(n+1,...

7 mois ago | 0

| accepted

Answered

generate random number from a function that serves as PDF ?

N = 1000; U = rand(N,1); n1 = numel(U(U<=w1)); n2 = N - n1; X1 = sigma1*randn(n1,1); X2 = sigma2*randn(n2,1); X = [X1,X2];...

generate random number from a function that serves as PDF ?

N = 1000; U = rand(N,1); n1 = numel(U(U<=w1)); n2 = N - n1; X1 = sigma1*randn(n1,1); X2 = sigma2*randn(n2,1); X = [X1,X2];...

7 mois ago | 0

Answered

How can I randomly extract a element in a vector?

random_element = v(randi(numel(v)))

How can I randomly extract a element in a vector?

random_element = v(randi(numel(v)))

7 mois ago | 0

| accepted

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...

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...

7 mois ago | 1

Answered

Unexpected output when trying to plot the solution to a system of nonlinear differential equations

Use hold on between the two plot commands.

Unexpected output when trying to plot the solution to a system of nonlinear differential equations

Use hold on between the two plot commands.

7 mois ago | 1

| accepted

Answered

How do I make a function work with vectors?

tanH = (exp(x)-exp(-x))./(exp(x)+exp(-x))

How do I make a function work with vectors?

tanH = (exp(x)-exp(-x))./(exp(x)+exp(-x))

7 mois 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));

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));

7 mois ago | 1

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.

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.

7 mois 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 ...

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 ...

7 mois ago | 0

| accepted

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 ...

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 ...

7 mois ago | 0

Answered

root of nonlinear equation

ft = @( c ) 0.25* ... instead of ft = 0.25* ...

root of nonlinear equation

ft = @( c ) 0.25* ... instead of ft = 0.25* ...

7 mois 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)...

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)...

7 mois 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

How to add the value of the 3 highest elements automatically from a vector?

[~,idx]=maxk(y,3); y(idx)=y(idx)+sx; y

7 mois ago | 0

Answered

Extracting values that are greater than the threshold

OxygenAlt = Alert(Alert(:,3)>21)

Extracting values that are greater than the threshold

OxygenAlt = Alert(Alert(:,3)>21)

7 mois ago | 0

Answered

Fitting to an intergral

Use "ArrayValued=true" as option in the call to integral.

Fitting to an intergral

Use "ArrayValued=true" as option in the call to integral.

7 mois 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,:...

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,:...

7 mois 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...

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...

7 mois ago | 1

| accepted

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...

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...

7 mois 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 ...

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 ...

7 mois 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.

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.

7 mois 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...

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...

environ un an ago | 0

| accepted