Community Profile

# Steven Lord

### MathWorks

4,622 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

Error using barrier Objective function is undefined at initial point. Fmincon cannot continue.
What values do you receive when you evaluate your objective function fun at the initial values in the start field of the paramet...

6 hours ago | 0

How to modify an anonymous function with another function
As written, y1sig and y2sig aren't function handles. You could make them function handles like this: f1 = @(d) sind(d); f2 = @...

1 day ago | 0

How I can correct this error? "Undefined operator '/' for input arguments of type 'function_handle'."
z=@(x) x(1)+x(2)+x(3)+x(4)+x(5); F1=@(x) 19720+(R*T*log(x(1)/z))-x(6)-4*x(7); You can't divide x(1) by the function handle z. ...

1 day ago | 2

| accepted

specifying the horizontal linetype '_' produces an error.
The horizontal and vertical line markers for plots were introduced in release R2020b. If you're using an older release you will ...

1 day ago | 2

| accepted

Property access in subclass
As you've defined A and B they are value classes but you're using them like they are handle classes. See this documentation page...

1 day ago | 0

| accepted

Error using odearguments with a symbolic system of differential equations
Your ODE function can use symbolic calculations internally but it must return a double or single array to the ODE solver. Call d...

2 days ago | 0

I can't find the mistake in the code
I've seen two different conventions for representing polynomials as vectors of coefficients. The one used by functions like poly...

2 days ago | 0

| accepted

How to extract input variable name when calling to GUI (GUIDE) function?
If you want your app to display the name of the file that was loaded, you should probably have your app accept the filename rath...

2 days ago | 1

System Error (MATLAB R2019a) after update

3 days ago | 1

| accepted

Why do I get these errors in Toolbox package? Help me out
The MCR directories in the directory for MATLAB Compiler should not be on the MATLAB path. If you've added toolbox\compiler\mcr ...

3 days ago | 0

| accepted

Error using 'pi' too many input errors with my equation
You're missing * operators after the two calls to pi on the line where you define y, just like you did on the lines where you de...

4 days ago | 0

| accepted

Even binned histogram to uneven bins?
Let's make some sample data. x = randi(255, 1, 1e5); Use bin edges that are the squares of the integers between 1 and 16. Each...

4 days ago | 0

Error using subplot using for loops: subplot index too large
Set a conditional breakpoint on the line where you call subplot. The condition is nVals1*4 < indexplot. Run your code. When MATL...

4 days ago | 0

Array of Structures (not structure array)
Consider a struct whose fields are themselves struct arrays. arr.asdf = struct('A', 3, 'B', 2); arr.zxcv = struct('A', 7, 'B',...

5 days ago | 1

| accepted

Unable to use CTRL+R to comment
Open the Preferences using the button in the Enviroment section on the Home tab of the Toolstrip. In the MATLAB section of the p...

5 days ago | 0

I'm not on the MATLAB Online team but I see in the Application Status page that there was an issue around noon that caused some ...

5 days ago | 0

| accepted

Setting Limits to end of table Variable
Use bounds and/or min and max on your time data to find the tight bounds and use those with xlim to adjust the limits.

5 days ago | 0

Simplifying a matematical expression
After inserting it into Answers using the sigma button on the toolstrip: Honestly, I wouldn't enter this as one term. As you ...

5 days ago | 1

How can i vectorize a matrix multiplication of higher dimension arrays?
If you're using release R2020b or later, take a look at the pagemtimes function introduced in that release.

5 days ago | 1

How to multiply N matrices without a FOR loop? (Slices of 3D array)
If you're using release R2020b or later, take a look at the pagemtimes function introduced in that release.

5 days ago | 0

Matching string from multiple arrays
If you have your data stored in timetable arrays, call synchronize with your three timetable arrays as input and specify the new...

5 days ago | 0

Table manipulation for saving variables
Here's a small example you could use as a model: T = array2table(magic(3)) % T is a 3-by-3 T(4, :) = {10, 11, 12} % T is now a...

5 days ago | 0

| accepted

How to enter a function into MATLAB
Is your calculator computing the cosine of angles in degrees (which in MATLAB is the cosd function) or in radians (cos)?

6 days ago | 0

Operations Research formulation in MATLAB
Looking at the code you posted as a comment I have a couple of observations and suggestions. The Queen's MATLAB was only an Apr...

6 days ago | 0

How can I multiply N dimensional matrices
See the pagemtimes function introduced in release R2020b.

6 days ago | 0

How can I check if a value in one array is in between two values in another array?
You want to discretize your data? edges = 0:2:10; sampleData = 10*rand(10, 1); whichBin = discretize(sampleData, edges); lef...

6 days ago | 0

MATLAB bug for plotting? Overlap between the x-ticks and the number labels: when using inverted y-axis and logarithmic x-axis.
When I run the code in the Description section of bug report 1832634 I see the same type of problem as in your reproduction step...

6 days ago | 1

My matlab R2020a cannot display 1 and 4 in the console and script
That is unusual, I don't think I've seen that behavior before. From your picture it looks like MATLAB can display the number 1 i...

6 days ago | 0

Creating legend based on numeric array
If you're using a newer release of MATLAB, I'd use a string array to create the legend. N = [1 7 14 30 90 180 360]; x = linspa...

6 days ago | 0