44,285 total contributions since 2011

I do not do free private consulting. If you want to bring my attention to something, send a link to the MATLAB Answers location.

Answered

How to change the x axis labels of a plot so that they only show integer values

ax = gca; ax.Xticks = unique( round(ax.XTicks) );

How to change the x axis labels of a plot so that they only show integer values

ax = gca; ax.Xticks = unique( round(ax.XTicks) );

2 hours ago | 0

Answered

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

If your x and y are 2D arrays (not vectors) with more than 1 column, then h and p will have one entry per column. Note that tte...

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

If your x and y are 2D arrays (not vectors) with more than 1 column, then h and p will have one entry per column. Note that tte...

2 hours ago | 0

Answered

How to use uigetfile to open subfolder's file.

[file,filepath] = uigetfile('*.txt'); if isempty(file); return; end %user cancel fullname = fullfile(filepath, file); WISET...

How to use uigetfile to open subfolder's file.

[file,filepath] = uigetfile('*.txt'); if isempty(file); return; end %user cancel fullname = fullfile(filepath, file); WISET...

2 hours ago | 1

| accepted

Answered

How to sort and rearrange time series data into random groups?

readtable(). If necessary, add the duration variable corresponding to the time, to the datetime variable for the date -- though ...

How to sort and rearrange time series data into random groups?

readtable(). If necessary, add the duration variable corresponding to the time, to the datetime variable for the date -- though ...

2 hours ago | 0

Answered

how to pull a single value from excel and use in a calculation in matlab.

Unless you can be certain that the user can only choose values that are present to within round-off error (e.g., that they will ...

how to pull a single value from excel and use in a calculation in matlab.

Unless you can be certain that the user can only choose values that are present to within round-off error (e.g., that they will ...

3 hours ago | 0

Answered

Display comma as decimal digits separator in simple 2D plots

No, the only way to do that is to build a TickLabels cell array of character vectors, or string object array, containing the cha...

Display comma as decimal digits separator in simple 2D plots

No, the only way to do that is to build a TickLabels cell array of character vectors, or string object array, containing the cha...

3 hours ago | 0

Answered

How to scalean array of data so that the first value is 1

https://www.mathworks.com/help/matlab/ref/double.normalize.html normalize() is R2018a or later and you are using R2017b. For r...

How to scalean array of data so that the first value is 1

https://www.mathworks.com/help/matlab/ref/double.normalize.html normalize() is R2018a or later and you are using R2017b. For r...

4 hours ago | 0

Answered

Shortcut for open searching panel of editor name?

I am not clear as to what you want, but it might possibly help to know that editors = matlab.desktop.editor.getAll; This is an...

Shortcut for open searching panel of editor name?

I am not clear as to what you want, but it might possibly help to know that editors = matlab.desktop.editor.getAll; This is an...

4 hours ago | 0

Answered

how to measure the diameter of a circle

bwareafilt to remove the small noise objects inside the circle. Invert the result so the open area becomes white. bwareafilt for...

how to measure the diameter of a circle

bwareafilt to remove the small noise objects inside the circle. Invert the result so the open area becomes white. bwareafilt for...

5 hours ago | 1

Answered

Trouble running glmnet in Matlab R2019b on Mac Os Catalina 10.15

You need to whitelist the executable; https://bugs.launchpad.net/gcc-arm-embedded/+bug/1832620

Trouble running glmnet in Matlab R2019b on Mac Os Catalina 10.15

You need to whitelist the executable; https://bugs.launchpad.net/gcc-arm-embedded/+bug/1832620

5 hours ago | 0

Answered

Can't numerically solve the integral

syms x b = 25; y(x) = 15*((0.2969*sqrt(x/25))-(0.1260*(x/25))-(0.3516*(x/25)^2)+(0.2843*(x/25)^3)-(0.1015*(x/25)^4)); %needs t...

Can't numerically solve the integral

syms x b = 25; y(x) = 15*((0.2969*sqrt(x/25))-(0.1260*(x/25))-(0.3516*(x/25)^2)+(0.2843*(x/25)^3)-(0.1015*(x/25)^4)); %needs t...

6 hours ago | 1

| accepted

Answered

i am facing this error again and again. can any help me how to solve this problem?

C:\Users\arshadali\Desktop\new dataset\watershed.m needs to be renamed. It is interfering with calling https://www.mathworks.com...

i am facing this error again and again. can any help me how to solve this problem?

C:\Users\arshadali\Desktop\new dataset\watershed.m needs to be renamed. It is interfering with calling https://www.mathworks.com...

9 hours ago | 0

Answered

Matlab doesn't "Pause on Error" till Infinite recursion

There are some third-party toolboxes that define isrow() and that interferes with MATLAB. Check which -all isrow What you see ...

Matlab doesn't "Pause on Error" till Infinite recursion

There are some third-party toolboxes that define isrow() and that interferes with MATLAB. Check which -all isrow What you see ...

19 hours ago | 1

Answered

Play sounds in background of GUI Matlab

You can use an audioPlayer object with play() method: that defaults to non-blocking. However, it is not all that good at playing...

Play sounds in background of GUI Matlab

You can use an audioPlayer object with play() method: that defaults to non-blocking. However, it is not all that good at playing...

19 hours ago | 0

Answered

Colour of legend doesn't change?

Your a looks to have multiple columns, so S1 would have multiple columns. plot(f,S1,'b'); would generate one line object per ...

Colour of legend doesn't change?

Your a looks to have multiple columns, so S1 would have multiple columns. plot(f,S1,'b'); would generate one line object per ...

20 hours ago | 0

| accepted

Answered

How to get all of the roots of a syatem of second order equation ?

It is not possible to use constraints with fsolve() What you can do is fmincon() on the square of your function; when you are l...

How to get all of the roots of a syatem of second order equation ?

It is not possible to use constraints with fsolve() What you can do is fmincon() on the square of your function; when you are l...

21 hours ago | 0

Answered

What do these different colors of stem plot indicates?

complex value matrix of size 512x40 stem() applied to real() and imag() of that is going to create 40 different stem plots. The...

What do these different colors of stem plot indicates?

complex value matrix of size 512x40 stem() applied to real() and imag() of that is going to create 40 different stem plots. The...

21 hours ago | 0

Answered

when i use inv to find the inverse matrix of A,i found inv(A)*A is not the identity matrix

H_AB = sqrt(1/2)*[randn(2,7) + j*randn(2,7)] You are building a 2 x 7 matrix. When you then do H_AB'*H_AB then the result has r...

when i use inv to find the inverse matrix of A,i found inv(A)*A is not the identity matrix

H_AB = sqrt(1/2)*[randn(2,7) + j*randn(2,7)] You are building a 2 x 7 matrix. When you then do H_AB'*H_AB then the result has r...

21 hours ago | 0

Answered

Run pushbutton automatically as soon as the GUI is visible without pressing the pushbutton

In the OpenFcn callback, create a timer object configured for a single execution, and have the callback for the timer object be ...

Run pushbutton automatically as soon as the GUI is visible without pressing the pushbutton

In the OpenFcn callback, create a timer object configured for a single execution, and have the callback for the timer object be ...

21 hours ago | 0

| accepted

Answered

is N210 USRP UBX-40 doughterboard supported by matlab

The software support package handles all daughter boards that are compatible with the UHD release being used. https://www.mathwo...

is N210 USRP UBX-40 doughterboard supported by matlab

The software support package handles all daughter boards that are compatible with the UHD release being used. https://www.mathwo...

22 hours ago | 0

| accepted

Answered

vpa adding ".0" to the end

https://www.mathworks.com/help/matlab/matlab_prog/searching-and-replacing.html regexprep can also be used. I can also offe...

vpa adding ".0" to the end

https://www.mathworks.com/help/matlab/matlab_prog/searching-and-replacing.html regexprep can also be used. I can also offe...

23 hours ago | 0

| accepted

Answered

How log is Student license?

Student licences are permanent. However you can only use them while you are enrolled in a degree granting institution. When you ...

How log is Student license?

Student licences are permanent. However you can only use them while you are enrolled in a degree granting institution. When you ...

23 hours ago | 0

Answered

Writing Code for function with CSV and character array

If the column number to extract is C then fmt = [repmat('%*s', 1, C-1), '%s', '%*[^\n]'] Now you can use that with texts...

Writing Code for function with CSV and character array

If the column number to extract is C then fmt = [repmat('%*s', 1, C-1), '%s', '%*[^\n]'] Now you can use that with texts...

1 day ago | 0

Answered

Numerical Methods - Broyden's Method. Error: Not enough input arguments

f = @(x,y) [(x+3)*(y^3-7)+18; sin(y*exp(x)-1)]; That is a function that needs two separate parameters. You are instead pass...

Numerical Methods - Broyden's Method. Error: Not enough input arguments

f = @(x,y) [(x+3)*(y^3-7)+18; sin(y*exp(x)-1)]; That is a function that needs two separate parameters. You are instead pass...

1 day ago | 0

| accepted

Answered

dynamic system whose position coordinates are defined by this relationship

MATLAB never permits indexing at 0. You will need to add 1 to all of your indices. x(0+1) and so on. Also, MATLAB does not perm...

dynamic system whose position coordinates are defined by this relationship

MATLAB never permits indexing at 0. You will need to add 1 to all of your indices. x(0+1) and so on. Also, MATLAB does not perm...

1 day ago | 0

| accepted

Answered

Function fails when called from another function

You do not initialize the profile variable. You assign to it inside of for loops that are potentially not being run, such as if ...

Function fails when called from another function

You do not initialize the profile variable. You assign to it inside of for loops that are potentially not being run, such as if ...

1 day ago | 1

| accepted

Answered

Error - No arguments -- dir"\"

Somewhere on your MATLAB path you have a function named directory, and you do not have a variable by that name that is visible t...

Error - No arguments -- dir"\"

Somewhere on your MATLAB path you have a function named directory, and you do not have a variable by that name that is visible t...

2 days ago | 0

Answered

NI-845x I2C/SPI Interface Support Package

All current matlab releases are 64 bit and the support packages are for 64 bit unless they say otherwise. Is the question whe...

NI-845x I2C/SPI Interface Support Package

All current matlab releases are 64 bit and the support packages are for 64 bit unless they say otherwise. Is the question whe...

2 days ago | 0

Answered

I have a 3×3 matrix and I have to multiply it to a 3×1 cell having matrices of dimensions 600×600. Kindly help me in doing so.

Guessing at what you want: nB = [reshape(B{1},1,[]); reshape(B{2},1,[]); reshape(B{3},1,[]); CB = C * nB; %this will give ...

I have a 3×3 matrix and I have to multiply it to a 3×1 cell having matrices of dimensions 600×600. Kindly help me in doing so.

Guessing at what you want: nB = [reshape(B{1},1,[]); reshape(B{2},1,[]); reshape(B{3},1,[]); CB = C * nB; %this will give ...

2 days ago | 0

Answered

gradient of discrete values

Your data needs to be sorted before you can compute numeric gradients. Note that your second column (lambda) is the independent...

gradient of discrete values

Your data needs to be sorted before you can compute numeric gradients. Note that your second column (lambda) is the independent...

2 days ago | 0