Community Profile

# Steven Lord

### MathWorks

3.666 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

How to convert polynomial equation into row matrix by a command?
Symbolic Math Toolbox has the sym2poly function that does this.

circa 13 ore ago | 0

Assigning arrays to edge properties of a graph
A two-element vector like [1 2] doesn't fit into one element of an array like G.Edges.property. If you were assigning the vecto...

2 giorni ago | 0

| accepted

How can I create n arrays of size 100 each with random integer values?
Since all of your arrays are the same size, I would consider stacking them in one of the dimensions in which they have size 1. ...

2 giorni ago | 0

system of non linear functions
It's unclear from what you've posted whether the last three lines of your code: fun = @root2d; x0 = [0,0]; x = fsolve(fun,x0)...

2 giorni ago | 0

| accepted

How can my function work?
In addition to what the others have stated, since you're using & in your if conditions I'm guessing you're passing a vector, mat...

3 giorni ago | 0

ODE triggered event does not stop
Your event function shouldn't use the relational operators itself. The only possible values your events can take on are 0 and 1 ...

4 giorni ago | 0

finding special date time
Find the next Sunday after a given date. T = datetime('today'); nextSun = dateshift(T, 'dayofweek', 'Sunday', 'next') All Sun...

4 giorni ago | 0

| accepted

Can anyone tell me the error with sum function?
Based on prior experience, I suspect you received the error "Array indices must be positive integers or logical values." If that...

4 giorni ago | 0

How to keep the precision of datetime when taking into consideration time offsets
You don't actually want a datetime array, you want a duration array. That's easy. First remove the fractional seconds. There's n...

4 giorni ago | 2

| accepted

Call function multiple times but execute once
I think it unlikely that ga is calling your function with exactly, down to the last bit, the same inputs multiple times. It's li...

5 giorni ago | 1

Out of memory (infinite recursion) running a stochastic collocation
[mean, stdev] = Stochastic_Collocation(x,nomforce); You call your function inside itself, which causes your function to cal...

6 giorni ago | 1

| accepted

Issue with atan2(.)
The atan2 function included in MATLAB requires exactly two input arguments. Therefore you're likely calling a different atan2.m ...

6 giorni ago | 0

Pre-allocating memory for a while loop
I'm running a code that is based on a while loop to similate a chemical process. It simulates an added amount of species each se...

6 giorni ago | 0

Is there any option to use boxlabelDatastore function in Matlab 2017b?
This function was introduced in Computer Vision Toolbox in release R2019b according to the note at the end of its documentation ...

6 giorni ago | 0

| accepted

Wrong left and right assignment error
for n= 1:1:100 l(n) = n.*(a.*b.*c); When you execute that second line of code, n is a scalar (size 1-by-1.) The variables ...

6 giorni ago | 0

wlan toolbox is incompleted
There's a note at the end of the documentation page that states this function was introduced in release R2019a. If you're using ...

9 giorni ago | 0

Using now() in different time zones (or with daylight saving time)
If you want control over the time zone, you probably want to use datetime instead of now. N1 = datetime('now', 'TimeZone', 'loc...

9 giorni ago | 0

| accepted

How to override inherited methods?
You can't do what you asked. If you could, you could relax the property setting validation to the point where your subClass inst...

10 giorni ago | 0

| accepted

Why is format long providing a strange result?
I recommend using format longg instead of format long for this case.

10 giorni ago | 1

Set properties of child objects without synchronisation errors
Let's take a step back from the code for a second. Can you describe the design of your system for which this set of classes will...

10 giorni ago | 1

How to require a custom class type with addRequired?
You probably want to use addParameter instead of addRequired. If you're using release R2019b or later, consider using function ...

10 giorni ago | 0

| accepted

Replacing <undefined> in categoricals or defining a default value
You could fillmissing to fill in the <undefined> entries, but if you want to leave them as missing data for future processing yo...

10 giorni ago | 0

How would I use Voronoi and/or Delaunay Triangulation methods for information on polygons
Why not just create a polyshape or an array of polyshape objects on which to operate? The NumRegions property gives you the numb...

10 giorni ago | 0

How to solve a ODE that is a function of a cubic polynomial f(x) = 0?
This doesn't look like a system of ODEs. The presence of the variable d in the first set of curly braces threw me for a second, ...

11 giorni ago | 0

Why is my for loop getting faster and faster?
This doesn't strike me as a bug. I suspect this is due to the execution engine introduced in release R2015b (which uses just-in-...

11 giorni ago | 0

| accepted

cannot modify plot axes as per documentation
Can you post the exact URL for the documentation page that says you can change the plot units by right-clicking, so we can see e...

11 giorni ago | 1

LDU factorization matrices help.
Use the ldl function.

12 giorni ago | 0

Find the data same week day one year ago.
You want the date exactly 52 calendar weeks ago? datetime('today')-calweeks(52)

13 giorni ago | 0

| accepted

Derivative using datenum format vector
Use the minutes function to compute the difference between two elements of a datetime array (or two datetime arrays) in terms of...

13 giorni ago | 0

| accepted