3.935 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

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')

etwa 11 Stunden 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....

etwa 13 Stunden 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: ...

etwa 13 Stunden 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 ...

ein Tag 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...

3 Tage 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...

3 Tage 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?

4 Tage 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...

5 Tage 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...

6 Tage 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...

6 Tage 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'})

6 Tage 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...

6 Tage 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...

6 Tage 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.

6 Tage 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.

7 Tage 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...

7 Tage 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]; ...

7 Tage 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...

7 Tage 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 ...

8 Tage 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.

9 Tage 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))

9 Tage 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...

9 Tage 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...

10 Tage 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...

10 Tage ago | 0

Answered

Change size 3D matrix

I think what you want is to use permute(EP(f,:,:),[2 3 1]) as the input, instead of just EP(f,:,:), so that you have a 2-d mat...

Change size 3D matrix

I think what you want is to use permute(EP(f,:,:),[2 3 1]) as the input, instead of just EP(f,:,:), so that you have a 2-d mat...

12 Tage ago | 0

Answered

Assigning a special character to a value

You can use the isvarname function to determine if something is a valid MATLAB variable name. The naming rules are here. (I sup...

Assigning a special character to a value

You can use the isvarname function to determine if something is a valid MATLAB variable name. The naming rules are here. (I sup...

12 Tage ago | 0

Answered

Issue with vectors?

Sorry to be snarky, but did you trying reading the error message? It tells you what to do right there. x = 0:.05:1; y = exp(-...

Issue with vectors?

Sorry to be snarky, but did you trying reading the error message? It tells you what to do right there. x = 0:.05:1; y = exp(-...

12 Tage ago | 0

Answered

When using listdlg, what is the value assigned when the user exits without making a selection?

Quoting the documentation for listdlg ... "If the user clicks Cancel, presses Esc, or clicks the close button in the dialog box...

When using listdlg, what is the value assigned when the user exits without making a selection?

Quoting the documentation for listdlg ... "If the user clicks Cancel, presses Esc, or clicks the close button in the dialog box...

12 Tage ago | 0

| accepted

Answered

Unmatched parameter name error when connecting to a PostgreSQL database

I am not able to test this right now, but it seems possible to me that MATLAB wants single quotes instead of double quotes aroun...

Unmatched parameter name error when connecting to a PostgreSQL database

I am not able to test this right now, but it seems possible to me that MATLAB wants single quotes instead of double quotes aroun...

12 Tage ago | 0