Community Profile

# Alan Stevens

##### Last seen: Today
838 total contributions since 2020

View details...

Contributions in
View by

How to change values for variables that are defined in a equation
More like this perhaps (of course you will need to use your on values for the constants): a = [75, 96.4]; b = [13.8, 14.1]; c...

alrededor de 1 hora ago | 0

plotting is giving me multiple lines
A little more like this perhaps: %%%FIBER Ef=220e9;%[N/m] GPA to Newton/square meter Vf=.63; %fiber volume fraction vf=.33;%...

alrededor de 5 horas ago | 0

I try to find the air under the curve of this signal
Like this? datacq= load('Acquisition.txt'); datacq(:,1)=datacq(:,1)-datacq(1,1); t=datacq(:,1)*10^-3; accelerationz=abs(data...

alrededor de 24 horas ago | 0

| accepted

ode45 second order
Matlab indices start at 1, so you want dy = [y(2); 3.6*sin(t) - 60*y(1) - 5*y(2)];

1 día ago | 0

Implement the following formula
Change the square brackets, [ ], to curved brackets, ( ). Put a multiply sign, *, after the 3.

2 días ago | 0

How to Solve a Second-Order Differential Equation?
syms x y eqn2 = 'x*D2y+2*Dy-x*y=2*exp(x)'; dsolve(eqn2,x)

2 días ago | 0

While solving with ode15 i want to put to the limit to variable.
Like this? opts = odeset('stats','on'); C0 = [6.21E-6, 0, 0, 0, 0]; %Initial Values (umol) tspan = 0:0.125:4400; %Time span...

2 días ago | 0

How to get the factor format of a polynomial
syms x y=x^2-1; a = factor(y) b = a(1)*a(2)

2 días ago | 0

How to change values for variables that are defined in a equation
Since your equation is linear in x it's probably best to rewrite as in the following, and put all your a,b,c,d vaues into vector...

3 días ago | 0

Solve an exponencial equation
Plot a graph of your function first, to see roughly where the root is, then use fzero: f = @(k) exp((-3.8./sqrt(6.784-1221.21*k...

3 días ago | 0

| accepted

Bessel problem "inf+ infi"
The following works with no inf or nan problems freq = linspace(4*1e6, 31*1e6, 100) ; w = 2*pi.*freq; % angular frequency p= ...

5 días ago | 0

| accepted

Need help to solve 5 simultaneous first order differential equations with Initial Condition.
You have a stiff system (ka~10^6, kd~10^-4), so use ode15s rather than ode45. The following works. I'll leave you to decide if ...

5 días ago | 0

| accepted

How to avoid repetition in for loop that is using randi
Does randperm do what you want? help randperm

6 días ago | 0

| accepted

Newton Raphson Method not solving
Try c3=-0.56; c4=0.182; c5=-0.09; c6=0.0102; Et=0.021; fn = @(x) c4*(2*x).^(c3) + c6*(2*x).^(c5) - Et; deriv = @(x) (c3)*...

6 días ago | 2

| accepted

Insert comment in the 4th quadrant of a subplot with Label and/or text
Like so? x = 0:0.1:10; y = sin(x); subplot(2,2,1) plot(x,y) subplot(2,2,2) plot(x,y+1/2) subplot(2,2,3) plot(x,y-1/2) s...

6 días ago | 0

Creating and solving a polynomial equal to zero.
Something like this A = [-5000 1200 750 2000 1200; -200 150 60 40 50]; A = fliplr(A); % Do this in order to use the roots fun...

6 días ago | 1

| accepted

How can I solve a system of ODE's, in which the equations have a dependency on time, as well as the other ODEs?
By substituting the first into the second and then the second into the third you can write the last two as:

7 días ago | 0

Random dots to make a circle
Try something like n = 1000; t = 2*pi*rand(n,1); Ri = 1; Ro = 2; r = Ri + (Ro - Ri)*rand(n,1); x0 = 0; y0 = 0; x = x0 +...

7 días ago | 0

| accepted

PDF & CDF function
Use histogram to see the shape. Move_W_to_dBm has a double peak at low values, with an extremely long tail to the right (I dele...

7 días ago | 0

| accepted

I get 'error using sum' whenever I try to get the mean of some numbers.
mean([1.0411, 1.0184, ...etc]) Enclose the numbers within square brackets.

7 días ago | 1

How to fit to an infinite series function when the independent variable contains an undetermined parameter?
fminsearch seems to do ok: x=[0 5 10 15 20 30 45 60 75 90 105 120]; y=[0 3.87 4.62 4.98 5.21 5.40 5.45 5.50 5.51 5.52 5.54 5.5...

7 días ago | 0

| accepted

sequence convergence of sqrt(2)
I think you probably want X(k) = 0.5*X(k-1) + 1/(2*X(k-1)); with X(1) = 1;

7 días ago | 0

Goertzel Algorithm for calculating amplitude and angle
Should it be more like this N = 80; % points/period f = 50; % Hz t = 0.02; % s TimeArray = 0:1/f/N:t; x = 2*cos(2*pi*f*Time...

8 días ago | 0

| accepted

The forward Euler scheme for an ordinary differential equation
More like this n=100; h=0.1; k=0; x(1)=0; y(1)=48; for k=1:n x(k+1)=x(k)+h; y(k+1)=y(k)+h*(9.8-0.196*y(k)); e...

8 días ago | 1

| accepted

Find values that put equation to zero
If your expression is equal to zero, then you can rearrange it to get gamma directly. A little algebra gives gamma = (C-M)./(S...

10 días ago | 1

Finding X values of multiple lines for a given Y value
Never test for exact equality when dealing with floating point numbers. Use something like index_50 = find(abs(t_ind50-consta...

10 días ago | 0

| accepted

Normalized histogram with gaussian fit
Here's an example showing one possibility: gaussian = @(x, m,s) exp(-0.5*((x-m)/s).^2)/(s*sqrt(2*pi)); mu = 5; ...

11 días ago | 0

| accepted

You have log(t) in the definition of B. This causes problems at t = 0.

12 días ago | 0

How to solve an elliptical integral with the unknown in the integrand?
Here's how to use fzero to find C. However, with Re = 100 and alpha = 15deg, the boundary condition integral never reaches 1 fo...

12 días ago | 1

| accepted