Answered

How to to report row at which the difference reaches below a threshold?

Probably the hardest part will be defining the exact rule for "sufficiently small difference". After that, I think something lik...

How to to report row at which the difference reaches below a threshold?

Probably the hardest part will be defining the exact rule for "sufficiently small difference". After that, I think something lik...

12 days ago | 0

| accepted

Answered

Take values from a matrix, line by line.

I would do this as follows: WDV = exp(A.'); and any time later I need to refer to "W", I would reference WDV(:,1). If you abs...

Take values from a matrix, line by line.

I would do this as follows: WDV = exp(A.'); and any time later I need to refer to "W", I would reference WDV(:,1). If you abs...

15 days ago | 0

| accepted

Answered

Unable to debug the problem in the code.

I'm guessing it's a problem with floating-point precision when you do this comparison: (time-flag*carrier_time_period)== carrie...

Unable to debug the problem in the code.

I'm guessing it's a problem with floating-point precision when you do this comparison: (time-flag*carrier_time_period)== carrie...

15 days ago | 1

| accepted

Answered

how to change a number of base n to base m

John D'Errico created the base2base function to do exactly this. Follow that link to the File Exchange. >> base2base('124',10,5...

how to change a number of base n to base m

John D'Errico created the base2base function to do exactly this. Follow that link to the File Exchange. >> base2base('124',10,5...

15 days ago | 0

| accepted

Answered

Weighted average between NaNs with movmean, determing window length?

You really lost me when you commented that the output would be a single value. How is that a moving average? Do you just want th...

Weighted average between NaNs with movmean, determing window length?

You really lost me when you commented that the output would be a single value. How is that a moving average? Do you just want th...

15 days ago | 0

Answered

Weighted average between NaNs with movmean, determing window length?

If my guess above is correct, then input = [1, 3 ,2 ,5 , NaN, NaN, 1, NaN, NaN, NaN, NaN, 4, 4, 7, 1, 3, NaN, 2, 5, 2, 3]; [...

Weighted average between NaNs with movmean, determing window length?

If my guess above is correct, then input = [1, 3 ,2 ,5 , NaN, NaN, 1, NaN, NaN, NaN, NaN, 4, 4, 7, 1, 3, NaN, 2, 5, 2, 3]; [...

15 days ago | 0

Answered

how to make make matlab compute values of simple trignometric identities?

Do you mean you want to solve for theta, in the equation cos(pi/2 + theta)= - sin(theta); ? Use solve.

how to make make matlab compute values of simple trignometric identities?

Do you mean you want to solve for theta, in the equation cos(pi/2 + theta)= - sin(theta); ? Use solve.

15 days ago | 0

Answered

This how i want the plot to be

Since you have spread similar questions across several places, without good organization (and one of them was closed), I'll post...

This how i want the plot to be

Since you have spread similar questions across several places, without good organization (and one of them was closed), I'll post...

15 days ago | 0

Answered

Rolling Beta For Multiple x and y variables simultaneously

I believe this does what you intend. % Set seed for reproducibility rng default % Set a few convenience parameters N = 100...

Rolling Beta For Multiple x and y variables simultaneously

I believe this does what you intend. % Set seed for reproducibility rng default % Set a few convenience parameters N = 100...

15 days ago | 1

| accepted

Answered

Extracting a slice from a 4D matrix

If your 4-dimensional array is A, then the first slice can be extracted using sliceA = A(1,:,:,:); As you say, this will be a ...

Extracting a slice from a 4D matrix

If your 4-dimensional array is A, then the first slice can be extracted using sliceA = A(1,:,:,:); As you say, this will be a ...

16 days ago | 0

| accepted

Answered

maximum likelihood did not converge for gevfit

I don't know for sure, but my best guess is that the problem is the relatively small amount of data, coupled with the fact that ...

maximum likelihood did not converge for gevfit

I don't know for sure, but my best guess is that the problem is the relatively small amount of data, coupled with the fact that ...

16 days ago | 1

| accepted

Answered

Fill an array with different size vectors

Here is one straightforward way: A=[1,2,3,4]; B=[5,6]; C=[7,8,9]; ARRAY=zeros(5); ARRAY(1,1:numel(A)) = A; ARRAY(2,1:nu...

Fill an array with different size vectors

Here is one straightforward way: A=[1,2,3,4]; B=[5,6]; C=[7,8,9]; ARRAY=zeros(5); ARRAY(1,1:numel(A)) = A; ARRAY(2,1:nu...

16 days ago | 1

Answered

Can you cancel my email change permission?

You should contact support for that request, rather than using the Answers forum.

Can you cancel my email change permission?

You should contact support for that request, rather than using the Answers forum.

19 days ago | 0

Answered

gesture recognition, with notification

Are you asking for help only for sending the message? I suggest you read this page from the great Undocumented Matlab web site. ...

gesture recognition, with notification

Are you asking for help only for sending the message? I suggest you read this page from the great Undocumented Matlab web site. ...

20 days ago | 0

Answered

what can i add to this code to plot in 3d

You already have a 3-dimensional plot, but you did not create a grid with fine enough spacing. Try using this instead: x = 0 : ...

what can i add to this code to plot in 3d

You already have a 3-dimensional plot, but you did not create a grid with fine enough spacing. Try using this instead: x = 0 : ...

20 days ago | 1

Answered

how to Expanand any matrix

I am not certain I interpreted your question correctly, especially the "righth shift the column by ones times". But I believe th...

how to Expanand any matrix

I am not certain I interpreted your question correctly, especially the "righth shift the column by ones times". But I believe th...

20 days ago | 0

Answered

Sum the component of a vector till a certain value

G(cumsum(G)<80)

Sum the component of a vector till a certain value

G(cumsum(G)<80)

21 days ago | 0

| accepted

Answered

How to Install New Versions

You should just be able to go to the downloads page of the MathWorks site. You do not need to uninstall your old version. (You ...

How to Install New Versions

You should just be able to go to the downloads page of the MathWorks site. You do not need to uninstall your old version. (You ...

21 days ago | 0

| accepted

Answered

Mean and standard deviation of a field - condition on another field

The mean and standard deviation of f1, for the elements where 50 < f2 <= 100, can be calculated as follows: arrayfun(@(x)mean(x...

Mean and standard deviation of a field - condition on another field

The mean and standard deviation of f1, for the elements where 50 < f2 <= 100, can be calculated as follows: arrayfun(@(x)mean(x...

22 days ago | 1

Answered

Calculate the number of nonzero rows

Use any instead of all. Your code is counting rows in which all entries are non-zero.

Calculate the number of nonzero rows

Use any instead of all. Your code is counting rows in which all entries are non-zero.

23 days ago | 1

Answered

Deleting several specific columns from a table

Do you know all the column indices you want to delete? It's as simple as columnIndicesToDelete = [4 5 6 7 9 12 14 15 17]; % and...

Deleting several specific columns from a table

Do you know all the column indices you want to delete? It's as simple as columnIndicesToDelete = [4 5 6 7 9 12 14 15 17]; % and...

23 days ago | 1

| accepted

Answered

How to generate realisations from two sets

L1 = length(S1); N1 = 2; S1(randperm(L1,N1)) will choose N1 numbers (in this case, 2) from S1. You can choose similarly fro...

How to generate realisations from two sets

L1 = length(S1); N1 = 2; S1(randperm(L1,N1)) will choose N1 numbers (in this case, 2) from S1. You can choose similarly fro...

24 days ago | 0

Answered

Matlab fit to three dimensions function

I would do it like this: % Set the random number generator seed, for reproducibility rng default % Create some random data ...

Matlab fit to three dimensions function

I would do it like this: % Set the random number generator seed, for reproducibility rng default % Create some random data ...

24 days ago | 0

Answered

extract specific values in a matrix

If A is your matrix: A(find(A(:,10)==0.03,1),10); You might need to be careful about getting an exact match with the floating-...

extract specific values in a matrix

If A is your matrix: A(find(A(:,10)==0.03,1),10); You might need to be careful about getting an exact match with the floating-...

24 days ago | 0

| accepted

Answered

Is it possible to change PATH temporarily?

This is not really an answer to your question, but this documentation about identifying program dependencies might also be usefu...

Is it possible to change PATH temporarily?

This is not really an answer to your question, but this documentation about identifying program dependencies might also be usefu...

25 days ago | 0

Answered

Connecting points between two box plots

I did not download notBoxPlot, but here is an example using a scatter plot instead. % Some pretend data N = 5; x = [randn(N,1...

Connecting points between two box plots

I did not download notBoxPlot, but here is an example using a scatter plot instead. % Some pretend data N = 5; x = [randn(N,1...

26 days ago | 1

| accepted

Answered

How to draw an "error bar" between two points on a scatter plot

I think you might be able to get something pretty close to what you want using the doublearrow annotation. (There is a property ...

How to draw an "error bar" between two points on a scatter plot

I think you might be able to get something pretty close to what you want using the doublearrow annotation. (There is a property ...

26 days ago | 0

| accepted

Answered

Encapsulated cell array (cell in cell) converting to 2D-array

cellfun performs an operation on every cell in a cell array. This line is equivalent your for loop: data = cellfun(@(x)cell2mat...

Encapsulated cell array (cell in cell) converting to 2D-array

cellfun performs an operation on every cell in a cell array. This line is equivalent your for loop: data = cellfun(@(x)cell2mat...

26 days ago | 0

Answered

Make one word in path name a variable

Yes, but you will need to be a little more specific about the rule for finding what part of the string you want. One step that m...

Make one word in path name a variable

Yes, but you will need to be a little more specific about the rule for finding what part of the string you want. One step that m...

26 days ago | 0