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

Having issues producing bar chart

I assume you got error from this line: xlabel(Animal ID''s') You have mismatched single quotes, i.e. "unbalanced delimiters", ...

Having issues producing bar chart

I assume you got error from this line: xlabel(Animal ID''s') You have mismatched single quotes, i.e. "unbalanced delimiters", ...

16 hours ago | 0

| accepted

Answered

How to sort a cell array based on the first row?

Out of curiosity, is there some reason you are using a cell array rather than a numeric array to store these numeric data? % Or...

How to sort a cell array based on the first row?

Out of curiosity, is there some reason you are using a cell array rather than a numeric array to store these numeric data? % Or...

3 days ago | 0

| accepted

Answered

How can a 4 element array index pull stored string values?

Can you upload examples of your variables fourElementVector and HexData, in a MAT file? This would be helpful. But it seems fro...

How can a 4 element array index pull stored string values?

Can you upload examples of your variables fourElementVector and HexData, in a MAT file? This would be helpful. But it seems fro...

3 days ago | 1

Answered

How to select all rows of a given column in a cell array

Your syntax: T{1}{:,4} would work if the contents of T{1| were also a cell array, since you would use the curly brackets to ac...

How to select all rows of a given column in a cell array

Your syntax: T{1}{:,4} would work if the contents of T{1| were also a cell array, since you would use the curly brackets to ac...

3 days ago | 0

Answered

Defining a fitline only up to a specific x-tick

It should be straightforward, but it is not possible to deduce from your code how to do it. In particular, since none of your va...

Defining a fitline only up to a specific x-tick

It should be straightforward, but it is not possible to deduce from your code how to do it. In particular, since none of your va...

4 days ago | 0

Answered

how to make 3d array by stacking 2d arrays from sentinel 5p data?

You are looping over the wrong dimension in your code. You want something like this: files = dir('S5P_OFFL_L2__CH4____201901*.*...

how to make 3d array by stacking 2d arrays from sentinel 5p data?

You are looping over the wrong dimension in your code. You want something like this: files = dir('S5P_OFFL_L2__CH4____201901*.*...

5 days ago | 0

| accepted

Answered

Is there a way to shift the data upwards automatically?

I tried plotting Height vs. Temperature, since that is what your plot shows. But my graph looks completely different from yours....

Is there a way to shift the data upwards automatically?

I tried plotting Height vs. Temperature, since that is what your plot shows. But my graph looks completely different from yours....

7 days ago | 1

| accepted

Answered

How to remove certain rows of data in a cell array using logical indexing?

Here is an example where I keep only rows of each matrix where the sum is greater than 1. Perhaps you can adapt it to your speci...

How to remove certain rows of data in a cell array using logical indexing?

Here is an example where I keep only rows of each matrix where the sum is greater than 1. Perhaps you can adapt it to your speci...

7 days ago | 0

| accepted

Answered

string for figure title ignores text after variable

Write it as one string, with the variable in the midst of it" t = 8.2; titlestr=sprintf('Time=%6.5f sec',t(1)); title(titles...

string for figure title ignores text after variable

Write it as one string, with the variable in the midst of it" t = 8.2; titlestr=sprintf('Time=%6.5f sec',t(1)); title(titles...

11 days ago | 0

| accepted

Answered

random selection of number among 2 numbers

Here are a couple ways: 2*randi([0 1]) 2*round(rand())

random selection of number among 2 numbers

Here are a couple ways: 2*randi([0 1]) 2*round(rand())

12 days ago | 1

Answered

How can I get un-descend index of latent in pca function

My answer to this question gives a detailed explanation of how to use MATLAB's pca function, including how to reduce the number ...

How can I get un-descend index of latent in pca function

My answer to this question gives a detailed explanation of how to use MATLAB's pca function, including how to reduce the number ...

12 days ago | 1

| accepted

Answered

Feature vector dimension reduction (PCA)

I have written an answer to this question that explains in detail how to use MATLAB's pca function, including how to do dimensio...

Feature vector dimension reduction (PCA)

I have written an answer to this question that explains in detail how to use MATLAB's pca function, including how to do dimensio...

12 days ago | 0

| accepted

Answered

Error using vertcat Dimensions of arrays being concatenated are not consistent.

data3 = [data1 data2] will concatenate them horizontally rather than vertically. You can do that, because they have the same nu...

Error using vertcat Dimensions of arrays being concatenated are not consistent.

data3 = [data1 data2] will concatenate them horizontally rather than vertically. You can do that, because they have the same nu...

15 days ago | 0

| accepted

Answered

build an array y depending on x

You have a few problems to fix: As you can see in its documentation, the input function requires you to include some prompting ...

build an array y depending on x

You have a few problems to fix: As you can see in its documentation, the input function requires you to include some prompting ...

16 days ago | 0

Answered

Unique numbers, not ordered

I believe this does what you want: X1 = [1 23 36 45 47 2]'; X2 = [1 36 47 2 6 ]'; X3 = [1 22 23 47 2 4]'; ...

Unique numbers, not ordered

I believe this does what you want: X1 = [1 23 36 45 47 2]'; X2 = [1 36 47 2 6 ]'; X3 = [1 22 23 47 2 4]'; ...

17 days ago | 0

Answered

Input from PCA to train in SVM

I have written a "tutorial" on how to use and interpret MATLAB's pca function here. Lots of users have asked questions (some of ...

Input from PCA to train in SVM

I have written a "tutorial" on how to use and interpret MATLAB's pca function here. Lots of users have asked questions (some of ...

18 days ago | 0

| accepted

Answered

Assign a label to a point of a matrix in if statement

By default, Kappa_j is going to be a numeric array, and there cannot accept character input. Instead, you could define it as a c...

Assign a label to a point of a matrix in if statement

By default, Kappa_j is going to be a numeric array, and there cannot accept character input. Instead, you could define it as a c...

19 days ago | 1

| accepted

Answered

Subtraction of set value from specific elements in column once criteria met

threshold = 5000; % Set this to the limit value you want x(x>threshold) = x(x>threshold) - 65535;

Subtraction of set value from specific elements in column once criteria met

threshold = 5000; % Set this to the limit value you want x(x>threshold) = x(x>threshold) - 65535;

21 days ago | 0

| accepted

Answered

Binary Logistic Regression - beginner

If you have the Statistics and Machine Learning Toolbox, you can use the fitglm function to fit a binomial logistic regression. ...

Binary Logistic Regression - beginner

If you have the Statistics and Machine Learning Toolbox, you can use the fitglm function to fit a binomial logistic regression. ...

24 days ago | 0

| accepted

Answered

conversion double to array

If you want your 34x1 double to be in a single cell of a cell array, then ... inder = rand(34,1); inderCell1 = {inder} If you...

conversion double to array

If you want your 34x1 double to be in a single cell of a cell array, then ... inder = rand(34,1); inderCell1 = {inder} If you...

25 days ago | 0

| accepted

Answered

Reproduce a best-fit 4-parameter sigmoid

It is difficult when you say you have no idea. But, here are a few thoughts. If you have never used MATLAB at all, then you hav...

Reproduce a best-fit 4-parameter sigmoid

It is difficult when you say you have no idea. But, here are a few thoughts. If you have never used MATLAB at all, then you hav...

25 days ago | 0

Answered

the "taylor" function does not work for me (beginner)

In the assignment statement for T3, you capitalized "Taylor". MATLAB is case-sensitive, so you must use "taylor".

the "taylor" function does not work for me (beginner)

In the assignment statement for T3, you capitalized "Taylor". MATLAB is case-sensitive, so you must use "taylor".

26 days ago | 2

Answered

Iterator goes infinite when changing step from 1 to 0.1

It's difficult to follow exactly what it going on in your code. I haven't traced the logic completely, but I figured out that wh...

Iterator goes infinite when changing step from 1 to 0.1

It's difficult to follow exactly what it going on in your code. I haven't traced the logic completely, but I figured out that wh...

26 days ago | 0

| accepted

Answered

Shorten the values from a column in another column.

The specific solution is potentially very dependent on ... the input format -- there are several way to read in Excel, leading ...

Shorten the values from a column in another column.

The specific solution is potentially very dependent on ... the input format -- there are several way to read in Excel, leading ...

26 days ago | 0

| accepted

Answered

Operations with function handles / anonymous functions

Is this what you want? function1 = @(x) x(1)^2+5 function2 = @(x) 2*x(2) function12 = @(x) function1(x) + function2(x)

Operations with function handles / anonymous functions

Is this what you want? function1 = @(x) x(1)^2+5 function2 = @(x) 2*x(2) function12 = @(x) function1(x) + function2(x)

27 days ago | 1

| accepted

Answered

Shorten the values from a column in another column.

If these are numeric values, I think maybe you can do output_values = unique(floor(input_values)); But see my comment above, f...

Shorten the values from a column in another column.

If these are numeric values, I think maybe you can do output_values = unique(floor(input_values)); But see my comment above, f...

27 days ago | 0

Answered

Covariance matrix as a diagonal matrix or not??????

I am definitely not an expert in this, but my guess is that these statements might only be strictly true for signals of infinite...

Covariance matrix as a diagonal matrix or not??????

I am definitely not an expert in this, but my guess is that these statements might only be strictly true for signals of infinite...

27 days ago | 0

Answered

summing columns based on certain interval

The best answer will depend on what specifically you want the output to be, and also how generalizable the solution needs to be....

summing columns based on certain interval

The best answer will depend on what specifically you want the output to be, and also how generalizable the solution needs to be....

27 days ago | 0

| accepted

Answered

How to delect the zero values in table

If all of the table entries are numeric, then this will work: % Create an example input table x = [0; 1; 0; 2]; y = [0; 1; 0;...

How to delect the zero values in table

If all of the table entries are numeric, then this will work: % Create an example input table x = [0; 1; 0; 2]; y = [0; 1; 0;...

27 days ago | 0

| accepted