# Alan Stevens

**Statistics**

**MATLAB Answers**

**0** Questions

**1,158** Answers

RANK**54**

of 272,927

REPUTATION**3,078**

CONTRIBUTIONS

**0** Questions

**1,158** Answers

ANSWER ACCEPTANCE **
0.00%
**

VOTES RECEIVED**312**

RANK

of 18,433

REPUTATION**N/A**

AVERAGE RATING**0.00**

CONTRIBUTIONS**0** Files

DOWNLOADS **0**

ALL TIME DOWNLOADS**0**

RANK

of 122,321

CONTRIBUTIONS

**0** Problems

**0** Solutions

SCORE**0**

NUMBER OF BADGES**0**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

Iteration of multiple nonlinear functions

Here's a quick and dirty way. I'll leave you to modify the following to record all the temperatures at every step. %Given valu...

7 days ago | 0

using num2str for subplot titles

Try title(['Q1S', num2str(k)]) i.e. enclose the two terms within square brackets.

9 days ago | 0

| accepted

control and simulation of petroleum distillation column

The following works, but probably doesn't contain all the right data or equations! % CALCULATE MATERIAL BALANCES FOR THE DISTIL...

10 days ago | 0

Error with plot command

You haven't specified function atten_func_dist, so we can't run your code to test it. You specify fre as a constant, then us...

11 days ago | 2

| accepted

How to combine multiple curve fits in one plot

Use hold on after plotting the first figure

13 days ago | 0

How to represent [airfoil] coordinates as a polynomial

How about using a spline fit? After loading your data and calling the first column x and the second column y try xfit = linspa...

15 days ago | 0

1D melting problem with Neumann's analytical solution

eps is a built-in constant so better not to use it as a variable. Your png files show it is xi not epsilon. Try the following ...

15 days ago | 0

| accepted

Overlay plots of different angles of incidence.

Remove the word figure and add hold on after the plot grid on [Fr,In] = meshgrid(Frequency,Incident); plot3(Fr,In,Reflectivit...

16 days ago | 0

How can write in MATLAB the following expression?

Try ket0 = [1; 0; 0] ket1 = [0; 1; 0]

18 days ago | 0

| accepted

I don't understand why does it give error?

Put the functions at the end. Tidy up one or two minor errors to get: %########### BF-PSO.m file ############# %####### Butter...

22 days ago | 0

How to count steps represented by the acceleration data given in text file?

Like this (you can plot the other two - look up help on subplot): M = csvread('walking.txt'); x = M(:,1); y = M(:,2); z = M(:,...

23 days ago | 0

| accepted

Bisection method add iteration table into my code

Something like this? my_fun = @(x) exp(x) - 3*x; low = 0; high = 1; tolerance = .00001; [x, x0] = bisection(my_fun, low, hi...

1 month ago | 0

I'm trying to solve this code for internal ballistic using ode45.This is my first time using ode

This works (note that Matlab doesn't accept implied multiplication), but doesn't look sensible - what about deriv(2)? y_initial...

1 month ago | 0

| accepted

Error with brackets symsum

Do you mean something more like this? N = 100; % Total number of particles one = 1; alpha = 1; K = 7; % 7 states n0 = 4*o...

1 month ago | 0

How to deal with rounding error in this example?

How about i = 1:20001; A = -2000 + (i-1)*0.2;

2 months ago | 1

Get back variables out of function inside a for loop

Here's one way J = [2.5 27 56]; WZ = [12.2 23.2 33]; M1 = 22; I1 = 2600; for ii = 1:numel(WZ) slope(ii) = (J(ii)-M1)...

2 months ago | 1

| accepted

Plot dispersion curves using Bloch theorem

Like this? OmegaR = 1; mR = 0.125; Omega = 0:0.01:2.5; mu = acos(1 - Omega.^2.*(1+mR./(1-Omega.^2/OmegaR^2))/2); plot(i...

2 months ago | 0

| accepted

how to do sensitivity analysis of three variables using MATLAB

Depends what your measure of sensitivity is. One possibility is to do a Monte-Carlo simulation and use the standard error on th...

2 months ago | 0

| accepted

I am trying to plot the each value of C at different theta values, but I found an error. Error: Invalid expression. When calling a function or indexing a variable, use parenth

Do you want something more along the following lines? c=[0.5,0.75,1,1.1]; theta=-pi:0.01:pi; %a=zeros(1,629); for k=1:numel(...

2 months ago | 0

Trying to make euler's method program work

Like this: % Arbitrary values here - insert your own x0 = 0; x_end = 10; h = 0.1; y0 = 1; n = fix((x_end-x0)/h)+1; ...

2 months ago | 0

Getting inaccurate eigenvalue with eig command. Please suggest me some other command or small series of steps to find accurate eigen value for Generalized Eigenvalue Problem.

Like this: A =[ -11.0913 0 0 0 0 0 0 0 0 0 0 ...

2 months ago | 0

| accepted

Why does integration of an exponential function generate noisy results as opposed to its analytical solution?

You have a singularity when t = x(ii). Here's a rough and ready way to do the numerical integral (hmm! not sure the result is c...

2 months ago | 0

| accepted

Index exceeds the number of array elements. Index must not exceed 1

What are yoy trying to do with x_iEm(i) - h*x_iEm(i) == x_past + h*2*y; when i = 2, there is, as yet, no value assigned to x_...

2 months ago | 1

| accepted

Inconsistent results from "int" function

You can express '(y*(2*x + y)^2)/192 as (x*y*(x + y))/48+y^3/198 As far as the integral is concerned y is a constant, so the t...

2 months ago | 2

| accepted

Boole's Approximation

You are using Boole from -1 to 1, but the "exact" from 0 to pi. (You should plot G against x to see why your "exact" integral w...

2 months ago | 1

I'm trying to solve a system of differential equations using Euler's method, but I don't know what the problem is with my code. If you can correct me the problem

Don't confuse the number 1 with lower case l a= 0; b= 2; delta_x =0.5; y1(1) = 4; y2(1) = 6; n= (b-a)/delta_x + 1 ; x(1)...

2 months ago | 0

| accepted

How to vertically concatenate a 2x1 table output in a loop, to form a 2x(i) table of outputs.

Try help stack

2 months ago | 0