Email: feel free to contact me regarding my shared files on the file exchange. I don't do free consulting outside of the forum so if you have a Matlab question, post the question to the forum and you may email me the link to the question.

About me: Finishing PhD soon on topics related to vision science; neurophysiology; sensory-motor feedback and control; control systems; steering & navigation; multisensory integration; top-down bottom-up feedback loop.

"If I had only one hour to save the world, I would spend fifty-five minutes defining the problem, and only five minutes finding the solution." -Albert Einstein

"An expert is a person who has made all the mistakes that can be made in a very narrow field." -Niels Bohr

"If you are not embarrassed by the first version of your product, you've launched too late" - Reid Hoffman

Answered

ttest NaN result is NaN and i am a beginner

Since this topic continues to surface within the forum, here's a summary of reasons why NaN values may appear in a ttest() outpu...

ttest NaN result is NaN and i am a beginner

Since this topic continues to surface within the forum, here's a summary of reasons why NaN values may appear in a ttest() outpu...

ongeveer 9 uur ago | 2

| accepted

Answered

Correct way to detect Zero crossing

The entire function can be replaced with y = I<1e-8; which will return a logical (true | false). If you want a double (1 | ...

Correct way to detect Zero crossing

The entire function can be replaced with y = I<1e-8; which will return a logical (true | false). If you want a double (1 | ...

ongeveer 12 uur ago | 0

Answered

Why does polyfit not exist in r2019b?

It does exist in r2019b. https://www.mathworks.com/help/matlab/ref/polyfit.html You have a variable with the same name so Matla...

Why does polyfit not exist in r2019b?

It does exist in r2019b. https://www.mathworks.com/help/matlab/ref/polyfit.html You have a variable with the same name so Matla...

ongeveer 17 uur ago | 0

| accepted

Answered

Filling area with pattern

Hi shane, filling with a pattern isn't trivial so I recommend the functions listed in the file exchange. However, here's a fai...

Filling area with pattern

Hi shane, filling with a pattern isn't trivial so I recommend the functions listed in the file exchange. However, here's a fai...

ongeveer 18 uur ago | 0

| accepted

Answered

Figure colorbar is not refreshed

Control the limits of the colorbar using caxis(). This line adjusts the colorbar limits to the range of your data. caxis([min...

Figure colorbar is not refreshed

Control the limits of the colorbar using caxis(). This line adjusts the colorbar limits to the range of your data. caxis([min...

ongeveer 19 uur ago | 0

| accepted

Answered

get the location of points in a plot by mouse interaction in app designer

That call back function uses fprintf() to display the results in the command window. To display the results as text in a textbox...

get the location of points in a plot by mouse interaction in app designer

That call back function uses fprintf() to display the results in the command window. To display the results as text in a textbox...

ongeveer 19 uur ago | 0

Answered

Why do I get an NaN error with the ttest?

Rather than copying the answer to here, see this review of possible causes of NaN output in ttest().

Why do I get an NaN error with the ttest?

Rather than copying the answer to here, see this review of possible causes of NaN output in ttest().

ongeveer 19 uur ago | 0

Answered

Matlab considers different two equal numbers!

You could limit the values in your matrix to the first 4 decimal places but this is usually not a good idea unles there's a reas...

Matlab considers different two equal numbers!

You could limit the values in your matrix to the first 4 decimal places but this is usually not a good idea unles there's a reas...

ongeveer 23 uur ago | 1

Answered

How can I find the parcentage of values in a vector that are bigger than 5.

" I want to calculate the number of values in that vector that are bigger than 5" p = sum(v>5)/numel(v); If there are NaNs yo...

How can I find the parcentage of values in a vector that are bigger than 5.

" I want to calculate the number of values in that vector that are bigger than 5" p = sum(v>5)/numel(v); If there are NaNs yo...

1 dag ago | 0

Answered

Why am I getting "Array indices must be positive integers or logical values"?

This line below implies that you're trying to index values from an array N where the index values must be positive integers or l...

Why am I getting "Array indices must be positive integers or logical values"?

This line below implies that you're trying to index values from an array N where the index values must be positive integers or l...

1 dag ago | 1

Answered

How to create 2D sub arrays by sampling every n by n points

The iter-loop is completely unnecessary and is merely doing the same exact work 1000 times. numIter=1000; tic % for iter=1:n...

How to create 2D sub arrays by sampling every n by n points

The iter-loop is completely unnecessary and is merely doing the same exact work 1000 times. numIter=1000; tic % for iter=1:n...

1 dag ago | 0

Answered

How can I put a display that shows changing variables in a plot?

Use h=text(. . .) to create the text object and then update the handle as needed. Here's a demo clf() axh = axes(); h =...

How can I put a display that shows changing variables in a plot?

Use h=text(. . .) to create the text object and then update the handle as needed. Here's a demo clf() axh = axes(); h =...

1 dag ago | 0

Answered

Change bar colors based on date

The only place in your data where I see moon phase is in column F of your spreadsheet and only the first month is indicated. Th...

Change bar colors based on date

The only place in your data where I see moon phase is in column F of your spreadsheet and only the first month is indicated. Th...

1 dag ago | 0

| accepted

Answered

how expand plots with different x-axis ranges

Specify the edges for both histograms rather than letting that funciton choose the bins. histogram(X,edges) If the data fro...

how expand plots with different x-axis ranges

Specify the edges for both histograms rather than letting that funciton choose the bins. histogram(X,edges) If the data fro...

1 dag ago | 0

Answered

Resize plot to fit text

Get the extent of the text objects after plotting the text. Add the vertical position and height to get the upper position of ...

Resize plot to fit text

Get the extent of the text objects after plotting the text. Add the vertical position and height to get the upper position of ...

2 dagen ago | 1

| accepted

Answered

Error using plot Vectors must be the same length.

The cross correlation function xcorr() will produce an output with 2*M-1 elements where M is the number of elements in the input...

Error using plot Vectors must be the same length.

The cross correlation function xcorr() will produce an output with 2*M-1 elements where M is the number of elements in the input...

2 dagen ago | 1

| accepted

Answered

Non linear least square fitting

Create noisy circular data This section creates the noisy data we're fitting. % Create randome points along a circle r = 22...

Non linear least square fitting

Create noisy circular data This section creates the noisy data we're fitting. % Create randome points along a circle r = 22...

2 dagen ago | 1

| accepted

Answered

How to read file .txt?

Assuming your text file is named myTextFile.txt and contains only that matrix, A = readmatrix('myTextFile.txt'); % for Matlab ...

How to read file .txt?

Assuming your text file is named myTextFile.txt and contains only that matrix, A = readmatrix('myTextFile.txt'); % for Matlab ...

2 dagen ago | 0

| accepted

Answered

How do I shade the xy plane at z=0 of my plot and how to stop the plot after it passes z=0?

The easiest solution is simply zlim([0,inf]) I also added grid on so we can see the 3D coordinates better. However, the data b...

How do I shade the xy plane at z=0 of my plot and how to stop the plot after it passes z=0?

The easiest solution is simply zlim([0,inf]) I also added grid on so we can see the 3D coordinates better. However, the data b...

2 dagen ago | 0

| accepted

Answered

How to display result in Text Area in Matlab Appdesigner

It's unclear whether you're working with numeric or text values. App designer has edit fields that return text and edit fields ...

How to display result in Text Area in Matlab Appdesigner

It's unclear whether you're working with numeric or text values. App designer has edit fields that return text and edit fields ...

2 dagen ago | 0

Answered

Print user-defined error messages as a table

msg = sprintf(['Polygon not supported. List of supported polygons is:\n' ... ' Triangle\n Square\n Pentagon\n Hexagon\n Hep...

Print user-defined error messages as a table

msg = sprintf(['Polygon not supported. List of supported polygons is:\n' ... ' Triangle\n Square\n Pentagon\n Hexagon\n Hep...

5 dagen ago | 0

| accepted

Answered

First cell in array is empty

oops! Typo... should be for i = 1:length(theta) % ^^ end Two more unrelated tips: Always pre-allocate your lo...

First cell in array is empty

oops! Typo... should be for i = 1:length(theta) % ^^ end Two more unrelated tips: Always pre-allocate your lo...

5 dagen ago | 1

| accepted

Answered

How to filter a cell array filled with strings?

This will return a logical array the same size as 'A' where TRUE values indicate elements of A that meet the following requireme...

How to filter a cell array filled with strings?

This will return a logical array the same size as 'A' where TRUE values indicate elements of A that meet the following requireme...

5 dagen ago | 1

| accepted

Answered

How can I use Textbox input from GUI in a separate script?

"I want to use the input of the textbox of my gui which i have created with guide, in a seperate Matlab script" There are sever...

How can I use Textbox input from GUI in a separate script?

"I want to use the input of the textbox of my gui which i have created with guide, in a seperate Matlab script" There are sever...

5 dagen ago | 0

Answered

Why is format long providing a strange result?

It's because of the way you're combing two variables in the output display. Look at the last iteration of your 2nd for-loop. ...

Why is format long providing a strange result?

It's because of the way you're combing two variables in the output display. Look at the last iteration of your 2nd for-loop. ...

5 dagen ago | 0

Answered

Swapping entries in column of table

I'm not sure why you're using string characters instead of numbers but I'll assume you have a reason for that. Here's how to ide...

Swapping entries in column of table

I'm not sure why you're using string characters instead of numbers but I'll assume you have a reason for that. Here's how to ide...

5 dagen ago | 0

| accepted

Answered

What does the 'imfuse' output mean?

Regarding the line of code Fused = imfuse(Image3, Image4, 'falsecolor'); For the falsecolor method, by default, Fused is a com...

What does the 'imfuse' output mean?

Regarding the line of code Fused = imfuse(Image3, Image4, 'falsecolor'); For the falsecolor method, by default, Fused is a com...

5 dagen ago | 1

Answered

STROOP TEST- COGENT

The handle to the text object and the handle to the "square" (not sure what you mean here, it could be a rectangle object, a pat...

STROOP TEST- COGENT

The handle to the text object and the handle to the "square" (not sure what you mean here, it could be a rectangle object, a pat...

5 dagen ago | 0

| accepted

Answered

On Startup: function name warning

None of the toolboxes are crashing - those are just warnings that you've got two functions with the same name. Don't delete a...

On Startup: function name warning

None of the toolboxes are crashing - those are just warnings that you've got two functions with the same name. Don't delete a...

5 dagen ago | 0

Answered

moving scroll index in a ui figure

TL;DR: Don't waste your time, it's not currently possible in AppDesigner (r2019b). Programmatically scrolling to a specific r...

moving scroll index in a ui figure

TL;DR: Don't waste your time, it's not currently possible in AppDesigner (r2019b). Programmatically scrolling to a specific r...

5 dagen ago | 1

| accepted