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

convert to cell array

You can probably use the datevec function datevec('19:33:02.58')

convert to cell array

You can probably use the datevec function datevec('19:33:02.58')

alrededor de 14 horas ago | 0

Answered

I have calculated Kupec's POF at 95% and 99% confidence levels. Under the 'Test level' column at last, all the values appear as 0.95. Shouldn't the values at 99% confidence level be 0.99? Please help.

The value-at-risk level and the confidence level at which you test that level, are two different things. You can prove that for...

I have calculated Kupec's POF at 95% and 99% confidence levels. Under the 'Test level' column at last, all the values appear as 0.95. Shouldn't the values at 99% confidence level be 0.99? Please help.

The value-at-risk level and the confidence level at which you test that level, are two different things. You can prove that for...

alrededor de 15 horas ago | 0

Answered

How do I create a box in Matlab?

I don't think the box command does what you think it does. Maybe you intended rectangle?

How do I create a box in Matlab?

I don't think the box command does what you think it does. Maybe you intended rectangle?

alrededor de 16 horas ago | 0

Answered

How to add each column of matrix A with another matrix B?

I think this does what you want: % Input data A = [1 20; 3 40]; B = [5 6 7; 8 9 10]; % Algorithm: % (1) Permu...

How to add each column of matrix A with another matrix B?

I think this does what you want: % Input data A = [1 20; 3 40]; B = [5 6 7; 8 9 10]; % Algorithm: % (1) Permu...

1 día ago | 0

| accepted

Answered

Factorial(1000) as number

The largest finite floating-point number in double precision is realmax For reference factorial(170) and factorial(171) Of...

Factorial(1000) as number

The largest finite floating-point number in double precision is realmax For reference factorial(170) and factorial(171) Of...

1 día ago | 0

Answered

Array indices must be positive integers or logical values.

Your variable A is the image data. Your variable t is the value of the image data at the (x,y) coordinate. That value of t coul...

Array indices must be positive integers or logical values.

Your variable A is the image data. Your variable t is the value of the image data at the (x,y) coordinate. That value of t coul...

3 días ago | 0

| accepted

Answered

Inconsistency of angle function in finding angle of vectors

I would not characterize this as an inconsistency, so much as a convention to report the value in the range [-pi,pi], rather tha...

Inconsistency of angle function in finding angle of vectors

I would not characterize this as an inconsistency, so much as a convention to report the value in the range [-pi,pi], rather tha...

3 días ago | 0

Answered

How to Apply PCA Corrrect way

Your question, especially when you ask about the 88x88 matrix that is output from pca(), indicates that you don't really underst...

How to Apply PCA Corrrect way

Your question, especially when you ask about the 88x88 matrix that is output from pca(), indicates that you don't really underst...

3 días ago | 0

| accepted

Answered

How can I fit Bessel function of 1st kind with the scatter plot?

I don't have the Curve Fitting Toolbox, so I cannot help with that. However, I used fitnlm, and I see a couple strange things a...

How can I fit Bessel function of 1st kind with the scatter plot?

I don't have the Curve Fitting Toolbox, so I cannot help with that. However, I used fitnlm, and I see a couple strange things a...

4 días ago | 0

| accepted

Answered

plot (t,y) ,dimension failure

The answer is right there in the error message. Use elementwise multiplication instead of matrix multiplication. clear all; clo...

plot (t,y) ,dimension failure

The answer is right there in the error message. Use elementwise multiplication instead of matrix multiplication. clear all; clo...

4 días ago | 1

| accepted

Answered

Check true if value in a matrix is increasing,decreasing or staying same

Use the diff command, and check whether the result is greater than zero, etc.

Check true if value in a matrix is increasing,decreasing or staying same

Use the diff command, and check whether the result is greater than zero, etc.

6 días ago | 0

| accepted

Answered

Unable to perform assignment because the left and right sides have a different number of elements.

It looks like inside your function, in these lines dS = ((-beta*(B/(B+k))*S(tt) + ub*(S(tt)+I(tt)+R(tt)) - ud*S) * dt)'; dI = ...

Unable to perform assignment because the left and right sides have a different number of elements.

It looks like inside your function, in these lines dS = ((-beta*(B/(B+k))*S(tt) + ub*(S(tt)+I(tt)+R(tt)) - ud*S) * dt)'; dI = ...

6 días ago | 0

Answered

Invalid Expression with plotting t

Your code works after I fix two typos: dt=0.01; h=0.1; w=0.1; to=2.5; t=0:dt:10; r=h*exp(-((t-to).^2)/w^2); plot(t,r,'b',...

Invalid Expression with plotting t

Your code works after I fix two typos: dt=0.01; h=0.1; w=0.1; to=2.5; t=0:dt:10; r=h*exp(-((t-to).^2)/w^2); plot(t,r,'b',...

6 días ago | 0

| accepted

Answered

How to use REGRESSION & INTERPOLATION ?

I don't think you need interpolation for this task. Do you have the Statistics and Machine Learning Toolbox? You could fit a no...

How to use REGRESSION & INTERPOLATION ?

I don't think you need interpolation for this task. Do you have the Statistics and Machine Learning Toolbox? You could fit a no...

6 días ago | 0

Answered

How to have a x-axis with repeating values (non-unique)

I have not seen a plot of this style. It's a bit confusing to me. I'm curious what the color background regimes are. Training, t...

How to have a x-axis with repeating values (non-unique)

I have not seen a plot of this style. It's a bit confusing to me. I'm curious what the color background regimes are. Training, t...

9 días ago | 0

| accepted

Answered

errors using Numerical Integration

I see three errors: (1) You need elementwise division instead of matrix division: y = @(x) 1./(sqrt(1+x.^4)); % note the adde...

errors using Numerical Integration

I see three errors: (1) You need elementwise division instead of matrix division: y = @(x) 1./(sqrt(1+x.^4)); % note the adde...

11 días ago | 1

| accepted

Answered

Uniformly distributed random variables

The main reason your output looks like this is that you are only generating ONE random value for each resistor -- and then recal...

Uniformly distributed random variables

The main reason your output looks like this is that you are only generating ONE random value for each resistor -- and then recal...

11 días ago | 0

Answered

pseudo code for all n values

Assuming that what you wanted was alternating pattern of 1's and 0's, regardless of how large n is, then this should do what you...

pseudo code for all n values

Assuming that what you wanted was alternating pattern of 1's and 0's, regardless of how large n is, then this should do what you...

12 días ago | 1

Answered

How to avoid "doubling up" in a RNG?

Here is one way to do what I think you mean: x = zeros(10,10); % For M and N, select 6 random integers from 1:10. M = randp...

How to avoid "doubling up" in a RNG?

Here is one way to do what I think you mean: x = zeros(10,10); % For M and N, select 6 random integers from 1:10. M = randp...

12 días ago | 1

Answered

Call matlab from STATA

I haven't run MATLAB from the command line in probably 20 years, but I think I would try putting the whole try-catch structure i...

Call matlab from STATA

I haven't run MATLAB from the command line in probably 20 years, but I think I would try putting the whole try-catch structure i...

12 días ago | 0

| accepted

Answered

Save a double array to a text file

Regardless of what is displayed to the MATLAB command window (in your case, the default format, it seems), an array of type doub...

Save a double array to a text file

Regardless of what is displayed to the MATLAB command window (in your case, the default format, it seems), an array of type doub...

13 días ago | 0

Answered

Doubt in a product erro

The reason has to do with the accuracy of floating-point math on a binary computer. I suggest you read this question and answer,...

Doubt in a product erro

The reason has to do with the accuracy of floating-point math on a binary computer. I suggest you read this question and answer,...

13 días ago | 1

Answered

How to only show part of a plot

You can set the axis limits of a plot using the xlim (and ylim and zlim) command. If that is not what you meant, I suggest you ...

How to only show part of a plot

You can set the axis limits of a plot using the xlim (and ylim and zlim) command. If that is not what you meant, I suggest you ...

15 días ago | 0

Answered

using logical functions to display arrays

When x is a vector, then if x < 10 is interpreted as "if all elements of x are less than 10". Your if statement is never enter...

using logical functions to display arrays

When x is a vector, then if x < 10 is interpreted as "if all elements of x are less than 10". Your if statement is never enter...

15 días ago | 0

Answered

Cody Problem 14. Find the numeric mean of the prime numbers in a matrix.

After you correct the problem that @Geoff Hayes pointed out in his comment, you still have a mathematical one. out = sum/2 is ...

Cody Problem 14. Find the numeric mean of the prime numbers in a matrix.

After you correct the problem that @Geoff Hayes pointed out in his comment, you still have a mathematical one. out = sum/2 is ...

16 días ago | 0

Answered

Simpsons rule function error

In this line of code: x=x(1)+h*(2*k-1); you have set x to a scalar value, so when you try to access x(2) in this line of code:...

Simpsons rule function error

In this line of code: x=x(1)+h*(2*k-1); you have set x to a scalar value, so when you try to access x(2) in this line of code:...

17 días ago | 1

| accepted

Answered

What Shall I need to add while calling file having numerical digits (e.g. -1,-2)?

You may want to try the functional form instead. load('Histories/IND.X0kY-1k.CXY.sema'); Also, what variables are in your work...

What Shall I need to add while calling file having numerical digits (e.g. -1,-2)?

You may want to try the functional form instead. load('Histories/IND.X0kY-1k.CXY.sema'); Also, what variables are in your work...

18 días ago | 0

Answered

clustering based on a custom function

I can't say that I have spent enough time with your code to fully understand it. But, I notice the following. Inside the loop o...

clustering based on a custom function

I can't say that I have spent enough time with your code to fully understand it. But, I notice the following. Inside the loop o...

19 días ago | 0

| accepted

Answered

data from one array to another

I can't tell what you intend to get from this expression [x(j),:] which is not valid MATLAB syntax. x(j) is the j-th element o...

data from one array to another

I can't tell what you intend to get from this expression [x(j),:] which is not valid MATLAB syntax. x(j) is the j-th element o...

20 días ago | 0

Answered

How do i get three colums as output?

t = data(:,[93,92,91]); will be the the last three columns from data, in reverse order.

How do i get three colums as output?

t = data(:,[93,92,91]); will be the the last three columns from data, in reverse order.

21 días ago | 1

| accepted