3.941 total contributions since 2011

Data scientist at Cohen Veterans Bioscience; Obsessive runner. Professional Interests: Predictive modeling, statistics. (I don't respond to email via author page, but will usually look at a question if you send me a link to it.)

Answered

How to know the number of colunma having the magnitude and the row number in a matrix.

A = [ 6 5 3 1 9 2 4 6 8 5 12 14 6 18 16] row = 2; val = 6; find(A(row,:)==val)

How to know the number of colunma having the magnitude and the row number in a matrix.

A = [ 6 5 3 1 9 2 4 6 8 5 12 14 6 18 16] row = 2; val = 6; find(A(row,:)==val)

alrededor de 17 horas ago | 1

Answered

Bar plot with negative and positive values, stacked, and with non-zero base value

For what it is worth, this is not a bug. It is a change that was documented in the release notes for R2019b. It's in the Graphic...

Bar plot with negative and positive values, stacked, and with non-zero base value

For what it is worth, this is not a bug. It is a change that was documented in the release notes for R2019b. It's in the Graphic...

alrededor de 17 horas ago | 1

Answered

How to initialize an array such that the values satisfies an equation

I think if I were going to try to solve that problem, I would take as a starting point Roger Stafford's function randfixedsum, f...

How to initialize an array such that the values satisfies an equation

I think if I were going to try to solve that problem, I would take as a starting point Roger Stafford's function randfixedsum, f...

alrededor de 19 horas ago | 0

| accepted

Answered

Why is the output of power spectrum this shape?

I expect that the answer to your question is embedded in the Spectrum Computation section of the documentation for pspectrum.

Why is the output of power spectrum this shape?

I expect that the answer to your question is embedded in the Spectrum Computation section of the documentation for pspectrum.

alrededor de 19 horas ago | 0

Answered

summing along 3rd dimension every 10 frames

Stephan provided a slick one-liner, but I think it might also be useful for you to see what mistakes you made. Here is a correct...

summing along 3rd dimension every 10 frames

Stephan provided a slick one-liner, but I think it might also be useful for you to see what mistakes you made. Here is a correct...

alrededor de 20 horas ago | 0

Answered

Anybody know how to import excel file or other (table) using MATLAB MOBILE?

If the Excel file is available in your MATLAB Drive, then you have a variety of options. One simple one is readtable. tbl = rea...

Anybody know how to import excel file or other (table) using MATLAB MOBILE?

If the Excel file is available in your MATLAB Drive, then you have a variety of options. One simple one is readtable. tbl = rea...

alrededor de 23 horas ago | 0

Answered

Correlation between two matrices

One possibility, which ignores any element for which A or B is NaN, is corrcoef(A,B,'rows','complete')

Correlation between two matrices

One possibility, which ignores any element for which A or B is NaN, is corrcoef(A,B,'rows','complete')

2 días ago | 1

Answered

How to re-arrange swapped elements in an estimated vector as compared to a reference vector

% Inputs u=[0.5 1 1.5 0.6981 1.3962 1.5707]; Est1=[0.499 1.002 1.5001 0.6890 1.3880 1.49998]; Est2=[0.9999 0....

How to re-arrange swapped elements in an estimated vector as compared to a reference vector

% Inputs u=[0.5 1 1.5 0.6981 1.3962 1.5707]; Est1=[0.499 1.002 1.5001 0.6890 1.3880 1.49998]; Est2=[0.9999 0....

2 días ago | 0

Answered

predicting CO2 using given data

Do you have the Statistic and Machine Learning Toolbox? If so then you could fit a simple linear model to your data like this: ...

predicting CO2 using given data

Do you have the Statistic and Machine Learning Toolbox? If so then you could fit a simple linear model to your data like this: ...

2 días ago | 0

Answered

How to plot over a range using absolute value

One way to do it would be to create a grid that is larger than the one you need, but then overwrite the x-y grid values that do ...

How to plot over a range using absolute value

One way to do it would be to create a grid that is larger than the one you need, but then overwrite the x-y grid values that do ...

3 días ago | 1

| accepted

Answered

Unpack arrayfun output into different variables

No, it is not possible. It is true that the output of arrayfun in this case is a 1x3 cell array. And you may feel that it is ob...

Unpack arrayfun output into different variables

No, it is not possible. It is true that the output of arrayfun in this case is a 1x3 cell array. And you may feel that it is ob...

5 días ago | 0

| accepted

Answered

Disappear of z coordinate when plotting 3D

I think you can "manually" fix this by setting the view. For example, try view(15,15) after the plot is made. I've seen a cou...

Disappear of z coordinate when plotting 3D

I think you can "manually" fix this by setting the view. For example, try view(15,15) after the plot is made. I've seen a cou...

5 días ago | 0

Answered

Helper Feature Vector2 Sequence

Do you have the Audio Toolbox installed? If you type ver at the command window prompt, do you see the Audio Toolbox listed?

Helper Feature Vector2 Sequence

Do you have the Audio Toolbox installed? If you type ver at the command window prompt, do you see the Audio Toolbox listed?

5 días ago | 0

Answered

Plot range with semilogx

You needed element-wise instead of matrix division in these two lines: eta = (EfEm - 1)./(EfEm + xi); y70 = (1 + xi * eta * .7...

Plot range with semilogx

You needed element-wise instead of matrix division in these two lines: eta = (EfEm - 1)./(EfEm + xi); y70 = (1 + xi * eta * .7...

6 días ago | 1

| accepted

Answered

Hi, how can i proceed with this question, everytime i plot it, it doesn't show me my line. Can u guys help me

It's because you used a matrix division instead of an element-wise division to calculate y. Try this instead: y = (exp(x)./ sin...

Hi, how can i proceed with this question, everytime i plot it, it doesn't show me my line. Can u guys help me

It's because you used a matrix division instead of an element-wise division to calculate y. Try this instead: y = (exp(x)./ sin...

7 días ago | 0

Answered

Multivariate Gaussian user defined function

I made a few changes: Define L as the first column of X, not just first value Ditto Y for second column Changed a couple matr...

Multivariate Gaussian user defined function

I made a few changes: Define L as the first column of X, not just first value Ditto Y for second column Changed a couple matr...

7 días ago | 0

| accepted

Answered

VariableNames for table that begins with number

Yes. tbl = table([1;2;3],'VariableName',{'123abc'})

VariableNames for table that begins with number

Yes. tbl = table([1;2;3],'VariableName',{'123abc'})

7 días ago | 0

| accepted

Answered

Quantile regression in Matlab

I am unaware of any built-in functions in MATLAB (including the Statistics and Machine Learning Toolbox) that perform quantile r...

Quantile regression in Matlab

I am unaware of any built-in functions in MATLAB (including the Statistics and Machine Learning Toolbox) that perform quantile r...

7 días ago | 0

| accepted

Answered

while loops not work using randsample

The specific reason is that you never enter the first while loop, because the condition eq1<1 && eq2>1 is never true. I didn't...

while loops not work using randsample

The specific reason is that you never enter the first while loop, because the condition eq1<1 && eq2>1 is never true. I didn't...

8 días ago | 0

| accepted

Answered

Is there an equivalent to the '+=' operator in MATLAB?

No, MATLAB does not have that syntax. There is some prior discussion of this issue in this question.

Is there an equivalent to the '+=' operator in MATLAB?

No, MATLAB does not have that syntax. There is some prior discussion of this issue in this question.

8 días ago | 1

| accepted

Answered

Index in position 1 is invalid. Array indices must be positive integers or logical values.

>> format long >> index index = 1.729000100000000e+03 index is not equal to 1729.

Index in position 1 is invalid. Array indices must be positive integers or logical values.

>> format long >> index index = 1.729000100000000e+03 index is not equal to 1729.

8 días ago | 0

Answered

Remove a row from an array

I don't quite understand. Do you mean that if a row from grid also appears as a row in yx, then that row should be removed from...

Remove a row from an array

I don't quite understand. Do you mean that if a row from grid also appears as a row in yx, then that row should be removed from...

9 días ago | 0

| accepted

Answered

Adding Matrices to make Bigger Matrix

Here is a straightforward way to do it with a for loop: A{1} = [ 1 -1; -1 1]; A{2} = [ 2 -2; -2 2]; ...

Adding Matrices to make Bigger Matrix

Here is a straightforward way to do it with a for loop: A{1} = [ 1 -1; -1 1]; A{2} = [ 2 -2; -2 2]; ...

9 días ago | 0

| accepted

Answered

Compare two tables and extract the columns similar to both

If I understand correctly, then C = B(:,ismember(B(1,:),A)) does what you want. From your example, it looks like A is a row v...

Compare two tables and extract the columns similar to both

If I understand correctly, then C = B(:,ismember(B(1,:),A)) does what you want. From your example, it looks like A is a row v...

9 días ago | 0

| accepted

Answered

I have a question about gathering same numbers together in a matrix

If M is your matrix, then M_sorted = sortrows(M,3) will output M sorted by the 3rd column, maintaining the order of the other ...

I have a question about gathering same numbers together in a matrix

If M is your matrix, then M_sorted = sortrows(M,3) will output M sorted by the 3rd column, maintaining the order of the other ...

10 días ago | 0

Answered

Compare two matrix row by row and check if at least one row is different, enter the if loop

The expression all(ismember(A,B,'row')) will be true if every row of A is represented in B, and false if not.

Compare two matrix row by row and check if at least one row is different, enter the if loop

The expression all(ismember(A,B,'row')) will be true if every row of A is represented in B, and false if not.

10 días ago | 1

Answered

Generation of rundon numbers with different scales

You aren't very specific, but the following will generate random values scaled by the value in M. r = 0.1*M.*randn(size(M))

Generation of rundon numbers with different scales

You aren't very specific, but the following will generate random values scaled by the value in M. r = 0.1*M.*randn(size(M))

10 días ago | 0

Answered

Why is Matlab PCA calculation different from results from R and Orange3?

Here's my guess: The difference between R and MATLAB is that in R, you scaled the data, in addition to centering them -- each c...

Why is Matlab PCA calculation different from results from R and Orange3?

Here's my guess: The difference between R and MATLAB is that in R, you scaled the data, in addition to centering them -- each c...

11 días ago | 1

Answered

Char to cell array of strings

output = regexp(c,'BL[\d.]*','match'); where c is your input character array. That will actually give a cell array of characte...

Char to cell array of strings

output = regexp(c,'BL[\d.]*','match'); where c is your input character array. That will actually give a cell array of characte...

11 días ago | 0

| accepted

Answered

Unmatched parameter name error when connecting to a PostgreSQL database

Sorry for the delayed reply, and I truly don't know if this will help or not. It does not seem to directly related to your error...

Unmatched parameter name error when connecting to a PostgreSQL database

Sorry for the delayed reply, and I truly don't know if this will help or not. It does not seem to directly related to your error...

12 días ago | 0