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

For assistance with MATLAB question please post to MATLAB Answers or contact Technical Support using the Contact Us link in the upper-right corner of the page instead of contacting me directly.

Answered

How can I average datetimes of my array?

Convert your table to a timetable using table2timetable. Once you have your timetable call retime on it.

How can I average datetimes of my array?

Convert your table to a timetable using table2timetable. Once you have your timetable call retime on it.

3 hours ago | 0

Answered

row dimension of aeq is inconsistent with length of beq. Help me pls.

You passed the inputs into fmincon in the wrong order. From the documentation page, the syntax you're calling is: x = fmincon(f...

row dimension of aeq is inconsistent with length of beq. Help me pls.

You passed the inputs into fmincon in the wrong order. From the documentation page, the syntax you're calling is: x = fmincon(f...

4 hours ago | 0

| accepted

Answered

Pan does not work

Run this command: which -all pan From the error message it sounds like you've created a Simulink model named pan that is takin...

Pan does not work

Run this command: which -all pan From the error message it sounds like you've created a Simulink model named pan that is takin...

4 hours ago | 0

Answered

how tocreate a new array that select the columns with a specific prefix in the header row

Read your data into a table array using readtable. Since I don't have your spreadsheet, I'll just create a sample table using th...

how tocreate a new array that select the columns with a specific prefix in the header row

Read your data into a table array using readtable. Since I don't have your spreadsheet, I'll just create a sample table using th...

1 day ago | 1

Answered

Re-hash the intrinsic Matlab plot function to accept a string as a y input?

You could turn your text data into a categorical array then plot with that categorical data as the Y input. colors = categorica...

Re-hash the intrinsic Matlab plot function to accept a string as a y input?

You could turn your text data into a categorical array then plot with that categorical data as the Y input. colors = categorica...

1 day ago | 1

Answered

I got "The expression to the left of the equals sign is not a valid target for an assignment."

Just eliminate that line from your code. The way you've defined x on the next line will make it complex since i is already defin...

I got "The expression to the left of the equals sign is not a valid target for an assignment."

Just eliminate that line from your code. The way you've defined x on the next line will make it complex since i is already defin...

2 days ago | 0

| accepted

Answered

Dynamic size differential equation system

There's no need for a loop here. Work on vectors. function dvhdt = myodefun(t, vh, alpha, optV, beta) % Compute N from the vh ...

Dynamic size differential equation system

There's no need for a loop here. Work on vectors. function dvhdt = myodefun(t, vh, alpha, optV, beta) % Compute N from the vh ...

2 days ago | 0

Answered

Blackjack Program -- Random Card Deal

Deal 4 cards from the deck at once. Give the dealer the first two and the player the next two. As written, your code can give t...

Blackjack Program -- Random Card Deal

Deal 4 cards from the deck at once. Give the dealer the first two and the player the next two. As written, your code can give t...

3 days ago | 0

Answered

symbolic variable multiplication with numerical matrix

When you perform that multiplication, Symbolic Math Toolbox converts your numbers into rational numbers rather than leaving them...

symbolic variable multiplication with numerical matrix

When you perform that multiplication, Symbolic Math Toolbox converts your numbers into rational numbers rather than leaving them...

4 days ago | 1

| accepted

Answered

Resetting individual properties to default values: 2018b

The most straighforward way is probably to define a Hidden, Constant property holding the default value. Since it's Hidden it wo...

Resetting individual properties to default values: 2018b

The most straighforward way is probably to define a Hidden, Constant property holding the default value. Since it's Hidden it wo...

5 days ago | 0

Answered

how to separate date and time into 6 tables 01/01/2014 0:10:00? (year,month,day,hours,minutes and second)

Use the datevec function.

how to separate date and time into 6 tables 01/01/2014 0:10:00? (year,month,day,hours,minutes and second)

Use the datevec function.

6 days ago | 0

Answered

How mink functions is used in 2016a or is there any alternate of this function ?

As stated at the end of the documentation page for mink, this function was "Introduced in R2017b". It does not exist in release ...

How mink functions is used in 2016a or is there any alternate of this function ?

As stated at the end of the documentation page for mink, this function was "Introduced in R2017b". It does not exist in release ...

6 days ago | 0

Answered

syms wrong message, definition

syms creates an Inf value as part of its operation, and you've enabled an error breakpoint that causes MATLAB to enter debug mod...

syms wrong message, definition

syms creates an Inf value as part of its operation, and you've enabled an error breakpoint that causes MATLAB to enter debug mod...

7 days ago | 0

| accepted

Answered

suptitle in 2016a

If you are using release R2018b or later, I recommend using the sgtitle function instead of suptitle. subplot(2, 2, 1); plot(1...

suptitle in 2016a

If you are using release R2018b or later, I recommend using the sgtitle function instead of suptitle. subplot(2, 2, 1); plot(1...

7 days ago | 0

Answered

How can I create this 2D waterfall plot?

That's not a waterfall plot, at least not by my understanding. To me a waterfall plot looks like the picture shown on the waterf...

How can I create this 2D waterfall plot?

That's not a waterfall plot, at least not by my understanding. To me a waterfall plot looks like the picture shown on the waterf...

7 days ago | 0

Answered

How can I represent the mean in figure

You can 'center' your data using the normalize function. As for "represent the data in figure" do you mean you want to plot the...

How can I represent the mean in figure

You can 'center' your data using the normalize function. As for "represent the data in figure" do you mean you want to plot the...

7 days ago | 0

Answered

Access different property from set method in class

As long as the get method for the useGpu property doesn't try to set the smaps property (leading to an infinite loop) and as lon...

Access different property from set method in class

As long as the get method for the useGpu property doesn't try to set the smaps property (leading to an infinite loop) and as lon...

7 days ago | 0

| accepted

Answered

New to MATLAB, question about num2str

I recommend not using datetime as the name of your variable as it already has a meaning in MATLAB. If you want to use a datetime...

New to MATLAB, question about num2str

I recommend not using datetime as the name of your variable as it already has a meaning in MATLAB. If you want to use a datetime...

7 days ago | 1

Answered

realmax + 1 infinity?

If you handed Bill Gates or Scrooge McDuck a $1 bill, it doesn't change what he'll report for his net worth. A single dollar is ...

realmax + 1 infinity?

If you handed Bill Gates or Scrooge McDuck a $1 bill, it doesn't change what he'll report for his net worth. A single dollar is ...

7 days ago | 1

Answered

Compatibility of R2015b on windows server 2016

According to the previous release system requirements page, Windows Server 2016 is not listed as a supported operating systems f...

Compatibility of R2015b on windows server 2016

According to the previous release system requirements page, Windows Server 2016 is not listed as a supported operating systems f...

8 days ago | 0

| accepted

Answered

How to change values of x axis from numbers to dates

Are you trying to change just the labels, or are you trying to change the underlying data in the plot? If the former, try the x...

How to change values of x axis from numbers to dates

Are you trying to change just the labels, or are you trying to change the underlying data in the plot? If the former, try the x...

8 days ago | 0

Answered

Trouble using retime to obtain 1 year of hourly average values from 15 years of hourly average values

So if I understand correctly, you want to take the mean of (for example) your data points for 1 AM January 1st 2018, 1 AM Januar...

Trouble using retime to obtain 1 year of hourly average values from 15 years of hourly average values

So if I understand correctly, you want to take the mean of (for example) your data points for 1 AM January 1st 2018, 1 AM Januar...

8 days ago | 0

Answered

syntax for random number

Take a look at the randi or randperm functions. If you need to generate numbers from a set that contains non-integer values, or...

syntax for random number

Take a look at the randi or randperm functions. If you need to generate numbers from a set that contains non-integer values, or...

8 days ago | 0

Answered

having error "Attempt to execute SCRIPT plot as a function: C:\Azam\non-linear\files\plot.m" in matlab when I want to plot

Rename the file C:\Azam\non-linear\files\plot.m to something else. While it exists in the current directory or in a directory on...

having error "Attempt to execute SCRIPT plot as a function: C:\Azam\non-linear\files\plot.m" in matlab when I want to plot

Rename the file C:\Azam\non-linear\files\plot.m to something else. While it exists in the current directory or in a directory on...

9 days ago | 0

Answered

Calculating within-month standard deviation from daily return data

Since this message was originally written we've introduced the timetable data type. I'd store the data in a timetable and call r...

Calculating within-month standard deviation from daily return data

Since this message was originally written we've introduced the timetable data type. I'd store the data in a timetable and call r...

9 days ago | 0

Answered

Find out if number is divisible by x

Take a look at the rem and mod functions.

Find out if number is divisible by x

Take a look at the rem and mod functions.

10 days ago | 1

Answered

What does 'Colormap' do to the image with double/float pixels？

Since your variable name is img, I assume you're planning to display this using the image function in MATLAB. If so look at the ...

What does 'Colormap' do to the image with double/float pixels？

Since your variable name is img, I assume you're planning to display this using the image function in MATLAB. If so look at the ...

10 days ago | 0

Answered

prime staircase (coding)

Search the documentation for "prime" and you will find a function that will be useful to you.

prime staircase (coding)

Search the documentation for "prime" and you will find a function that will be useful to you.

10 days ago | 0

Answered

Matching based on working days

If possible, switch to using datetime instead of serial date numbers. You can use the datetime options 'ConvertFrom', 'excel' or...

Matching based on working days

If possible, switch to using datetime instead of serial date numbers. You can use the datetime options 'ConvertFrom', 'excel' or...

10 days ago | 0