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 plot this figure? please help me.

I suggest you look for code for a similar figure in the MATLAB Plot Gallery.

How to plot this figure? please help me.

I suggest you look for code for a similar figure in the MATLAB Plot Gallery.

3 Tage ago | 0

| accepted

Answered

How to reorganize an array given an index

Here is one way: % Inputs array = [1,2,3,4,5,NaN,NaN,NaN]; idx_flag = [1,4,8]; % Get length of array for convenience L = ...

How to reorganize an array given an index

Here is one way: % Inputs array = [1,2,3,4,5,NaN,NaN,NaN]; idx_flag = [1,4,8]; % Get length of array for convenience L = ...

3 Tage ago | 1

| accepted

Answered

How can I plot a histogram out of a vector of percentages

I don't think you want a histogram (which would create the percentages from the raw data). I think you just need a bar graph.

How can I plot a histogram out of a vector of percentages

I don't think you want a histogram (which would create the percentages from the raw data). I think you just need a bar graph.

4 Tage ago | 0

| accepted

Answered

how to calculate distance euclidean

c(m,n) is the absolute value of the difference between the m-th element of the vector stored in a and the n-th element of the ve...

how to calculate distance euclidean

c(m,n) is the absolute value of the difference between the m-th element of the vector stored in a and the n-th element of the ve...

4 Tage ago | 0

Answered

My is my matrix can't multiply with this vector

Your variables tranposeA and y have sizes 2x4 and 1x4, respectively. It is unclear to me whether you wanted a matrix multiplica...

My is my matrix can't multiply with this vector

Your variables tranposeA and y have sizes 2x4 and 1x4, respectively. It is unclear to me whether you wanted a matrix multiplica...

5 Tage ago | 0

| accepted

Answered

How to assemble 3D array from four vectors

Here is one way: G = reshape([FF; MF; FM; MM],2,2,6)

How to assemble 3D array from four vectors

Here is one way: G = reshape([FF; MF; FM; MM],2,2,6)

6 Tage ago | 0

| accepted

Answered

how to graph using loop?

Put the command hold on on the line after figure. See the documentation for the hold command for details.

how to graph using loop?

Put the command hold on on the line after figure. See the documentation for the hold command for details.

6 Tage ago | 0

| accepted

Answered

How to arrange indices of a real array ?

Rankig = [ 0.6229 , 0.6516 , 0.2036 , 0.0997 , 0.5986 , 0.5897 , 0.7667 , 0.4887]; [~,Indexes] = sort(Rankig); [~,Indexes2...

How to arrange indices of a real array ?

Rankig = [ 0.6229 , 0.6516 , 0.2036 , 0.0997 , 0.5986 , 0.5897 , 0.7667 , 0.4887]; [~,Indexes] = sort(Rankig); [~,Indexes2...

7 Tage ago | 0

Answered

How to arrange indices of a real array ?

You are just interpreting the output incorrectly. [B, Indexes] ans = 0.7667 0.6516 0.6229 0.5986 0.5897 ...

How to arrange indices of a real array ?

You are just interpreting the output incorrectly. [B, Indexes] ans = 0.7667 0.6516 0.6229 0.5986 0.5897 ...

7 Tage ago | 0

Answered

Finding unique slices of a multidimensional array

% Define a 3-d array of pretend data, that has a couple duplicate slices % (Use your data instead) rng default A = rand(2,2,4...

Finding unique slices of a multidimensional array

% Define a 3-d array of pretend data, that has a couple duplicate slices % (Use your data instead) rng default A = rand(2,2,4...

8 Tage ago | 1

| accepted

Answered

Cell returns different number of rows in a loop - How to align this?

Something like this should help: % Define the old and new phases info phases_old = {'eta';'mu'}; phases_new = {'eta';'mu';'mu...

Cell returns different number of rows in a loop - How to align this?

Something like this should help: % Define the old and new phases info phases_old = {'eta';'mu'}; phases_new = {'eta';'mu';'mu...

10 Tage ago | 0

| accepted

Answered

How to calculate the slope of select data points across entire dataset?

Here is a straightforward method. I commented the code, so I hope you can follow the algorithm I didn't see how you wanted to c...

How to calculate the slope of select data points across entire dataset?

Here is a straightforward method. I commented the code, so I hope you can follow the algorithm I didn't see how you wanted to c...

18 Tage ago | 0

| accepted

Answered

Why do i get tstat Inf after a linear regression?

The root cause is that your model is "perfect". The model is effectively y = b1 + b2*x1 + b3*x2 + b4*x1*x2 which means you hav...

Why do i get tstat Inf after a linear regression?

The root cause is that your model is "perfect". The model is effectively y = b1 + b2*x1 + b3*x2 + b4*x1*x2 which means you hav...

22 Tage ago | 0

Answered

Hold on function doesn't work

The problem with your code is not with the hold command. The problem is the syntax to plot the line. You plotted a 1x200 vector ...

Hold on function doesn't work

The problem with your code is not with the hold command. The problem is the syntax to plot the line. You plotted a 1x200 vector ...

30 Tage ago | 0

Answered

Very confused about MLE

Let's step back to the big conceptual picture. The mle function is estimating the most likely parameters for a distribution of s...

Very confused about MLE

Let's step back to the big conceptual picture. The mle function is estimating the most likely parameters for a distribution of s...

etwa ein Monat ago | 2

| accepted

Answered

How to show the plot with the highest value?

plot(h,max(abs(T1),abs(T2)))

How to show the plot with the highest value?

plot(h,max(abs(T1),abs(T2)))

etwa ein Monat ago | 0

Answered

how to plot only one datapoint at a time with a 1 second delay from a dataset

Here is one way: TestPoints=[1 4 6;2 1 4;3 2 3;4 1 5;5 3 4;6 1 6;7 2 6;8 2 6]; figure for nr = 1:size(TestPoints,1) pl...

how to plot only one datapoint at a time with a 1 second delay from a dataset

Here is one way: TestPoints=[1 4 6;2 1 4;3 2 3;4 1 5;5 3 4;6 1 6;7 2 6;8 2 6]; figure for nr = 1:size(TestPoints,1) pl...

etwa ein Monat ago | 0

| accepted

Answered

how to make intervals in a bar graph

Here is one way: w = 42.5 : 5.0 : 62.5; n = [4 12 13 6 5]; bar(w,n,'BarWidth',1) FYI, if you have the underlying ind...

how to make intervals in a bar graph

Here is one way: w = 42.5 : 5.0 : 62.5; n = [4 12 13 6 5]; bar(w,n,'BarWidth',1) FYI, if you have the underlying ind...

etwa ein Monat ago | 0

Answered

How to get a random vector whose elements arrangement is the same as that of my desired vector

Do you want something like this, which adds some random "noise" around the elements of u? u = [3 1 5 105 155 50]; m = 10; n...

How to get a random vector whose elements arrangement is the same as that of my desired vector

Do you want something like this, which adds some random "noise" around the elements of u? u = [3 1 5 105 155 50]; m = 10; n...

etwa 2 Monate ago | 0

Answered

Error using plot Not enough input arguments.

If you take a look at the documentation for the plot function, you will see that it cannot take cell arrays as input. I'm not e...

Error using plot Not enough input arguments.

If you take a look at the documentation for the plot function, you will see that it cannot take cell arrays as input. I'm not e...

2 Monate ago | 0

Answered

shuffle indexes when sorting matrix

One way that springs to mind is to add a small, random "jitter" to the values in the image. The jitter magnitude should be small...

shuffle indexes when sorting matrix

One way that springs to mind is to add a small, random "jitter" to the values in the image. The jitter magnitude should be small...

2 Monate ago | 1

| accepted

Answered

How to suppress this error?

Two thoughts: First: Are you certain you have the correct warning? After you run your code that gives the warning, what is the ...

How to suppress this error?

Two thoughts: First: Are you certain you have the correct warning? After you run your code that gives the warning, what is the ...

2 Monate ago | 0

Answered

Dot indexing is not supported for variables of this type???

Complete guess here. Are you simply trying to multiply the two variables? If so, then E(i).*tx(rr-1) Just using a dot, by itse...

Dot indexing is not supported for variables of this type???

Complete guess here. Are you simply trying to multiply the two variables? If so, then E(i).*tx(rr-1) Just using a dot, by itse...

2 Monate ago | 0

Answered

How to interpret entries in documentation's left pane

In that left-hand pane, the following pages are at the same "level of the documentation hierarchy": Get Started with MATLAB Com...

How to interpret entries in documentation's left pane

In that left-hand pane, the following pages are at the same "level of the documentation hierarchy": Get Started with MATLAB Com...

2 Monate ago | 1

Answered

Probability of Combinations Occurring

By "unique combinations", I assume you mean unique rows. Here is one way: % Example dataset. (Use your data instead.) x = [7 ...

Probability of Combinations Occurring

By "unique combinations", I assume you mean unique rows. Here is one way: % Example dataset. (Use your data instead.) x = [7 ...

2 Monate ago | 0

Answered

multiplying scalar by matrix

In the exponentials, you missed an important set of parentheses, ensuring that you divide by the whole expression (lambda .* k ...

multiplying scalar by matrix

In the exponentials, you missed an important set of parentheses, ensuring that you divide by the whole expression (lambda .* k ...

2 Monate ago | 0

| accepted

Answered

How can i create a for loop that modifies a column in an existing matrix?

I would use the histcounts command to do this task: A = [1,1,3,4,5,1]; dicevalue = [1,2,3,4,5,6]'; throwCounts = histcounts...

How can i create a for loop that modifies a column in an existing matrix?

I would use the histcounts command to do this task: A = [1,1,3,4,5,1]; dicevalue = [1,2,3,4,5,6]'; throwCounts = histcounts...

2 Monate ago | 0

| accepted

Answered

Question about writing a function.

In the future, you might want to separate two such different questions as two different posts here. For your first question, wh...

Question about writing a function.

In the future, you might want to separate two such different questions as two different posts here. For your first question, wh...

2 Monate ago | 0

| accepted

Answered

How to same size of plot and histogram

I think that using h1= histogram(data2p,'Normalization','pdf'); h2= histogram(data3p,'Normalization','pdf'); and of course r...

How to same size of plot and histogram

I think that using h1= histogram(data2p,'Normalization','pdf'); h2= histogram(data3p,'Normalization','pdf'); and of course r...

2 Monate ago | 1

| accepted