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

Help with 2D plot from a matrix

Continuing from the comments under the question. Using imagesc, you can change the tick labels using set(gca, 'XTick', 1:3, ...

Help with 2D plot from a matrix

Continuing from the comments under the question. Using imagesc, you can change the tick labels using set(gca, 'XTick', 1:3, ...

environ 13 heures ago | 0

Answered

Representing certain range of X axis using a single tick in MATLAB plot

Two options X = [1,2,3,4,5,6,7]; Y = [10,10,10,10,20,30,40]; xIdx = [1,5,6,7]; bar(X(xIdx), Y(xIdx)) ax = gca(); ax.XT...

Representing certain range of X axis using a single tick in MATLAB plot

Two options X = [1,2,3,4,5,6,7]; Y = [10,10,10,10,20,30,40]; xIdx = [1,5,6,7]; bar(X(xIdx), Y(xIdx)) ax = gca(); ax.XT...

1 jour ago | 1

| accepted

Answered

Not sure how to fix my matrix dimension problem

t is a 1x41 vector; wd and zeta are both 1x7 vectors. You can't do pairwise multiplication with two arrays of different size. ...

Not sure how to fix my matrix dimension problem

t is a 1x41 vector; wd and zeta are both 1x7 vectors. You can't do pairwise multiplication with two arrays of different size. ...

1 jour ago | 1

Answered

How can I sort an array to follow a path?

I don't know much about reading in stl files but you might want to look into options that would read in the points in different ...

How can I sort an array to follow a path?

I don't know much about reading in stl files but you might want to look into options that would read in the points in different ...

1 jour ago | 0

Answered

Counting characters in a file

Here's a demo to count the instances of a character in a text file. This demo searches for a space character ' ' and then repl...

Counting characters in a file

Here's a demo to count the instances of a character in a text file. This demo searches for a space character ' ' and then repl...

1 jour ago | 0

| accepted

Answered

Stop plotting on MATLAB

The switch/case in your question does the same thing no matter what case was selected so why have it at all? The reason you're ...

Stop plotting on MATLAB

The switch/case in your question does the same thing no matter what case was selected so why have it at all? The reason you're ...

1 jour ago | 0

Answered

Plotting trendline and normally distributed numbers

"I need to change my variable e in a way that it represents normally distributed numbers with a mean 0 and a standard deviation ...

Plotting trendline and normally distributed numbers

"I need to change my variable e in a way that it represents normally distributed numbers with a mean 0 and a standard deviation ...

1 jour ago | 0

Answered

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.

The transformation matrix produces a 3x3 matrix and you're attempting to store the 3x3 matrix into a single 1x1 space in A(i). ...

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.

The transformation matrix produces a 3x3 matrix and you're attempting to store the 3x3 matrix into a single 1x1 space in A(i). ...

1 jour ago | 0

Answered

How to use bootstrap technique among multiple data sets by choosing data sets randomly

"... i want to use all the 10 sections data i.e. EH1 to EH10 in bootsrtp function for 500 iterations to get Zfinal." Why split ...

How to use bootstrap technique among multiple data sets by choosing data sets randomly

"... i want to use all the 10 sections data i.e. EH1 to EH10 in bootsrtp function for 500 iterations to get Zfinal." Why split ...

1 jour ago | 0

Answered

Insert all in matrix

You can either store the outputs in a cell array like this i=1; for S=0.05:0.05:1 LIV{i}=ricerca(V0,W,S,N) % ^ ^ ...

Insert all in matrix

You can either store the outputs in a cell array like this i=1; for S=0.05:0.05:1 LIV{i}=ricerca(V0,W,S,N) % ^ ^ ...

2 jours ago | 0

| accepted

Answered

How to graph values of a function above and below 0 as separate functions?

The conditional statements in your code aren't doing what you think they are doing. They return true only when the entire vecto...

How to graph values of a function above and below 0 as separate functions?

The conditional statements in your code aren't doing what you think they are doing. They return true only when the entire vecto...

2 jours ago | 1

Answered

how to add a single blank row in a table

Note that "missing" values are represented by NaN values for numeric data. % Create demo table T = array2table(reshape(1:9,3,...

how to add a single blank row in a table

Note that "missing" values are represented by NaN values for numeric data. % Create demo table T = array2table(reshape(1:9,3,...

2 jours ago | 0

Answered

Conversion to cell from double is not possible.

dx{k} = imfilter(g{k},h1); dy{k} = imfilter(g{k},h2); % ^ ^ Use curley brackets or dx(k) = {imfilter(g{k},h...

Conversion to cell from double is not possible.

dx{k} = imfilter(g{k},h1); dy{k} = imfilter(g{k},h2); % ^ ^ Use curley brackets or dx(k) = {imfilter(g{k},h...

2 jours ago | 1

| accepted

Answered

Which version I should download for 2 GB RAM?

Look through this table that lists the minimum system requirements across all Matlab releases for multiple systems. R2017b (M...

Which version I should download for 2 GB RAM?

Look through this table that lists the minimum system requirements across all Matlab releases for multiple systems. R2017b (M...

2 jours ago | 0

Answered

Calculate longterm daily average

Create timetable (from OP's code) mat = randi([0 14600], 730, 5, 2); sc1 = (datetime(1981,1,1):datetime(1982,12,31))'; splitm...

Calculate longterm daily average

Create timetable (from OP's code) mat = randi([0 14600], 730, 5, 2); sc1 = (datetime(1981,1,1):datetime(1982,12,31))'; splitm...

2 jours ago | 1

| accepted

Answered

Error using plot Invalid data argument.

function y = U(t) t = -3:0.0001:3; y= 1*(t>=0); plot(t,U(t)) % ^^^^problem You're recursively calling the U(t) functio...

Error using plot Invalid data argument.

function y = U(t) t = -3:0.0001:3; y= 1*(t>=0); plot(t,U(t)) % ^^^^problem You're recursively calling the U(t) functio...

2 jours ago | 0

Answered

how can I combine several file.fig together

It's unclear whether you want to combine each line into the same axes or if you want to combine each axes into the same figure a...

how can I combine several file.fig together

It's unclear whether you want to combine each line into the same axes or if you want to combine each axes into the same figure a...

2 jours ago | 0

| accepted

Answered

VLookup Multiple Conditions if statements

No need for a function. See inline comments for details. Matrices % Define matrix m = randi(3,2000,5); % Define sear...

VLookup Multiple Conditions if statements

No need for a function. See inline comments for details. Matrices % Define matrix m = randi(3,2000,5); % Define sear...

3 jours ago | 0

| accepted

Answered

shift horizontal histogram to right

Here's a demo that shows how to compute a probability density estimate for each column of data and how to plot the PDF curve nex...

shift horizontal histogram to right

Here's a demo that shows how to compute a probability density estimate for each column of data and how to plot the PDF curve nex...

3 jours ago | 1

| accepted

Answered

No data tip interaction when adding a second axis

ax2 is blocking ax1. The datatip on ax2 works fine but there are no data in ax2 so you're not seeing any datatips. Solution: P...

No data tip interaction when adding a second axis

ax2 is blocking ax1. The datatip on ax2 works fine but there are no data in ax2 so you're not seeing any datatips. Solution: P...

3 jours ago | 0

| accepted

Answered

How do i select a random cell with a certain value from the matrix

% Create matrix of 0s & 1s M = round(rand(1024, 1280)); % List all indices of 1s loc = find(M==1); % Randomly select one o...

How do i select a random cell with a certain value from the matrix

% Create matrix of 0s & 1s M = round(rand(1024, 1280)); % List all indices of 1s loc = find(M==1); % Randomly select one o...

3 jours ago | 0

| accepted

Answered

how to find the Reverse process of A(B).

A=[1 3 2 4 5 6 7 8 8 9 11]; B=[10 4 3 1 7 6 9 5 2 8 11]; C = A(B); A2(B) = C; However, if B contains duplicate values, ...

how to find the Reverse process of A(B).

A=[1 3 2 4 5 6 7 8 8 9 11]; B=[10 4 3 1 7 6 9 5 2 8 11]; C = A(B); A2(B) = C; However, if B contains duplicate values, ...

3 jours ago | 1

| accepted

Answered

What is the default figure font in Matlab 2014b?

To get default font properties without the need to create an axes, get(groot, 'defaultAxesFontName') get(groot, 'defaultAxesF...

What is the default figure font in Matlab 2014b?

To get default font properties without the need to create an axes, get(groot, 'defaultAxesFontName') get(groot, 'defaultAxesF...

4 jours ago | 1

Answered

How to read a matrix line by line in a for loop from a txt file and save it as a 4-dimensional matrix?

No need to use loops! big_matrix1 = permute(reshape(matrix(:,1), [2 7 10 10]), [4,3,2,1]); big_matrix2 = permute(reshape(ma...

How to read a matrix line by line in a for loop from a txt file and save it as a 4-dimensional matrix?

No need to use loops! big_matrix1 = permute(reshape(matrix(:,1), [2 7 10 10]), [4,3,2,1]); big_matrix2 = permute(reshape(ma...

5 jours ago | 0

| accepted

Answered

How to control color inside a for loop

I haven't dug too deeply into the two threads but I think this will work for you. If not, I'll remove the answer so the questio...

How to control color inside a for loop

I haven't dug too deeply into the two threads but I think this will work for you. If not, I'll remove the answer so the questio...

5 jours ago | 0

| accepted

Answered

please help me to code below problem

The question mentions "random temperatures" between 0 and 5. Your random values are all integers but random temperatures would ...

please help me to code below problem

The question mentions "random temperatures" between 0 and 5. Your random values are all integers but random temperatures would ...

5 jours ago | 1

| accepted

Answered

App Designer: Can't delete Figure "app.UIAxes" permanently

This is really bizarre. Source of the problem The problem is caused by the 2nd UIAxes not having a handle assigned in the app...

App Designer: Can't delete Figure "app.UIAxes" permanently

This is really bizarre. Source of the problem The problem is caused by the 2nd UIAxes not having a handle assigned in the app...

6 jours ago | 1

| accepted

Answered

How can I use sliders to scroll through my data in GUI?

How do I use callbacks to connect all sliders, so they show the same value? You can assign the same callback function to multip...

How can I use sliders to scroll through my data in GUI?

How do I use callbacks to connect all sliders, so they show the same value? You can assign the same callback function to multip...

6 jours ago | 0

| accepted

Answered

Standard deviation, Mean values for each class

Use grpstats() if you have the Stats & Machine Learning Toolbox. data = [ 1 1 1.5 1.5 2 2; 10 9 7 6 3.5 8]',; [dataMean, data...

Standard deviation, Mean values for each class

Use grpstats() if you have the Stats & Machine Learning Toolbox. data = [ 1 1 1.5 1.5 2 2; 10 9 7 6 3.5 8]',; [dataMean, data...

6 jours ago | 1

| accepted