Community Profile # Steven Lord

### MathWorks

4 915 total contributions since 2002

I joined The MathWorks in the Technical Support department during the summer of 2001 and transferred into the Quality Engineering department in March of 2004. I now work qualifying the core MATLAB numerical functions (PLUS, MINUS, LU, FFT, ODE45, etc.)
Professional Interests: mathematics, MATLAB

View details...

Contributions in
View by

Using sigma notation when index is included in fucntion
There's no need to use symsum here. The sum function will be sufficient. A = diag([1 2 4 8]) D = eig(A) s = sum(1./D) % The ....

environ une heure ago | 0

How can I access a field of a struct, if I have a cell-Array containing all the subfields?
data.car.speed = 10; data.car.color = 'white'; data.duration = 1000; data.format = 'A4' pathToField = {'car', 'speed'}; S =...

environ 3 heures ago | 0

| accepted

Error using odeset "Not Enough Input Arguments"
[t,Y] = ode45(@(t,X) rocket(t,X),tspan,ini,change); Based on the error message, change is a local function (a subfunction) insi...

environ 3 heures ago | 0

How to calculate the mean/median/Standard deviation for each column in a table
Let's look at a sample table. load patients T = table(LastName, Smoker, Height, Weight, Systolic, Diastolic); head(T) It mak...

environ 4 heures ago | 0

MATLAB Function Generates the Vertices of a Regular N-gon with Line Segments
You might find the degree-based trig functions sind and cosd useful. If you need to work exclusively with radians, the sinpi and...

environ 5 heures ago | 0

Why does pcolor require you to transpose the matrix when you give it x and y vectors?
Suppose you have an M by N matrix of data called A. Associated with that data is a vector in the x-direction with length M and a...

environ 7 heures ago | 0

Variable not being saved/stored from function
function [ZWF,XWF,ZRF,XRF] = walk_run(n) Your function declaration does not list XWI as a variable that it returns to its calle...

1 jour ago | 0

Why does pcolor not display the full matrix?
This is not a bug. The perceived bug is the result of the 2-dimensional fencepost error. From the description of the C input arg...

1 jour ago | 0

How to show every iteration step of lsqnonlin()?
You probably want to specify a PlotFcn as part of the options that get passed into lsqnonlin. See this documentation page for mo...

1 jour ago | 0

matlab error ode45
If you call your rolling function with the first element of tspan and the initial condition vector x0 as inputs, do you receive ...

2 jours ago | 0

Linspace giving me undefined function 'uminus'
Here's what appears to be the relevant section of code. b = app.RadiusStalk; E = app.ElasticModulus; ...

2 jours ago | 0

| accepted

Cannot get the function to draw function
% t1 = 0: 1/10000 : 5; % funkce1 = exp(-3*t)-2; Is funkce1 supposed to use t or t1? I could see it using the symbolic variable...

2 jours ago | 0

Changing version of Python in MATLAB
See the "Set Python Version on Mac and Linux Platforms" section on this documentation page.

2 jours ago | 0

Syms function no longer works in a for loop which stores data
If you try to do something like the following: %{ syms x F = 0; F(2) = x; %} What numeric value should be stored in F(2) a...

2 jours ago | 0

Getting Error message when using backslash operator
You've posted the dydtsys_practice function that implements the right-hand side of your system of ODEs, but to solve the system ...

3 jours ago | 0

| accepted

How to find the index of a randomly chosen element of an array
Start off generating the index and use it to extract the element. a = [4 8 15 16 23 42]; I = randi(numel(a)); fprintf("Elemen...

3 jours ago | 2

Timestamp to Decimal day of year
dt = datetime('now', 'TimeZone', 'EST') startOfYear = dateshift(dt, 'start', 'year') fractionOfYear = years(dt - startOfYear) ...

4 jours ago | 0

Imagine a dice tetra-brick (four faces: 1, 2, 3, 4) with the following probabilities [0.5, 0.2, 0.2, 0.1] . Let Y be the Random Variable that simulate the output of rolling the dice.
Use histcounts or histogram. Alternately if this is part of a homework assignment and you're instructed not to use those functi...

4 jours ago | 0

How can I define the variable handles for this code. A is a numerical value not text "Undefined variable handles or class "handles.A"
Generally speaking, usually code that involves a struct array named handles is part of a GUI created using GUIDE. If you're tryi...

4 jours ago | 0

Simple, but stumped. Using 'xline' to create animated "play marker" across waveform plot.
Rather than deleting and recreating the line, change its properties. % Define the data x = 0:360; y = sind(x); % Create th...

5 jours ago | 1

The fix(x) command does not work
Just because a number is displayed as 1 in the default display format does not mean that the stored value is exactly 1. It's clo...

5 jours ago | 0

How to replace all newline characters in a string with a space?
Since this sounds like it may be a homework assignment, I'll only give a hint. There's one function in the "Create, Concatenate,...

5 jours ago | 0

Checking if a value is equal to zero or no ? with the problem of floating-point numbers !
Testing for exact, down-to-the-last-bit equality with == can be problematic. Instead, the general recommendation is to check for...

5 jours ago | 0

Help With Conditonally variant Anonymous function.
Let's say val is 2. So if Z is between 1 and 500 B2 should be -2, if it is between 501 and 1500 B2 should be 2, and if it is bet...

6 jours ago | 0

How do I call a function which I have defined within a class?
When you call a non-Static method of a class, at least one of the inputs to that method must be an instance of that class. With ...

7 jours ago | 1

Different results with same code??
m_s = 2000; %(kg) Sprung mass m_u = 200; %(kg) Un-sprung mass k_s = 200000...

8 jours ago | 0

Creating M histograms from an NxM table on separate plots
A = 2*randn(1e4, 6) + 5*(0:5); T = array2table(A); for k = 1:width(T) subplot(2, 3, k) histogram(T{:, k}) end Note...

8 jours ago | 1

| accepted

Operands on table, comparison with numbers
say I fix one of the row indices " ind" .If I try say find(A(ind,:)>0.1) I get the error : "Operation '>' not supported for oper...

8 jours ago | 0

| accepted