Domanda


fprintf's at beginning and end of a function called witihin parfor loop
I am trying to write logging-type information to the command window from inside a function that is called within a parfor loop. ...

circa 2 anni fa | 2 risposte | 0

2

risposte

Risposto
How do I loop a command for different variable names?
Another alternative is to make a function that does all of the necessary operations on each vector, and then call that function ...

circa 2 anni fa | 0

Risposto
How to add random Noise between 2% in the dataset
Do you mean that you want to multiply each value in the dataset by a random number between 1.005 and 1.02, with all random numbe...

circa 2 anni fa | 0

Risposto
Control for Confounding Variables in a Linear Regression Model
Suppose you have a variable X that you would like to predict from a set of predictors P and you want to control for some other v...

circa 2 anni fa | 0

| accettato

Risposto
how does fitglm treat categorical variables?
I don't that is correct. WIth numerical values in the table, I think you have to mark the variables as categorical with somethi...

circa 2 anni fa | 0

| accettato

Risposto
how to plot shorter dataset using 'hold on'
Is this what you need? desired_range = 1:200; % here, select the array positions you want to plot plot(T5half(desired_range),...

circa 2 anni fa | 0

| accettato

Risposto
How to generate a vector of numbers picked from two groups with the condition that there cannot be more than 2 consecutive numbers from the same group?
If I understand what you are asking, this should be close to what you want: vecLength = 20; % how many numbers you want to gen...

circa 2 anni fa | 0

Risposto
How to fit multiple distribution on a histogram without normalizing the histogram?
Probably simplest just to plot everything and then use ylim to reset the Y axis limits at the end to whatever you want, somethin...

circa 2 anni fa | 0

| accettato

Domanda


How can I make more efficient use of parallel workers?
My code performs 30 iterations of a task via parfor, with 6 workers in the parallel pool. Each iteration writes files when it s...

circa 2 anni fa | 1 risposta | 0

1

risposta

Risposto
Given a null distribution, how can I calculate a p-value for my test statistic?
The one-tailed p value is just the tail probability of your original unshuffled difference relative to the null distribution tha...

circa 2 anni fa | 0

Risposto
How to turn a function handle with 3 inputs (1 variable and 2 parameters) and then assign the inputs parameters and get a function handle with one input? ?
Not sure I understand the situation, but this sounds to me like a case where an OO approach could be very helpful. Consider: cl...

circa 2 anni fa | 0

Risposto
Repeated measures ANOVA Matlab (Statistic)
% Note the transpose operator: single-column vectors are more convenient. A = [10 11 13 16 15 18 17 16 11 12]'; B = [20 22 21 ...

circa 2 anni fa | 0

| accettato

Risposto
How to fit an uniform distribution to a histogram?
histogram(data, numBars); avgHeight = numel(data)/numBars; hold on; plot([min(data), max(data)],[avgHeight, avgHeight])

circa 2 anni fa | 1

Risposto
Spearman correlation fails in ranking strings
The first two inputs to the corr command have to be the numerical values that are to be correlated, so you will want something l...

circa 2 anni fa | 1

| accettato

Risposto
I want to compute mean median and mode for the distribution from its c.d.f.
The median is the value at p=0.50, which you already seem to have in your table. You can't really compute the mean and mode fr...

circa 2 anni fa | 0

Risposto
How to calculate StdErr for intercepts and slopes in a multivariate ANCOVA (function ANOVAN() with continuous independent variable)?
If you set up dummy variables to code your categorical independent variables, you can then do analysis of covariance with fitlm....

circa 2 anni fa | 2

| accettato

Risposto
Is it appropriate to use ranksum to compare statistical means for time series data?
The ranksum test ignores the sequential order of scores, so for example ranksum(x,y) will give you the same answer no matter how...

oltre 2 anni fa | 0

Risposto
pca with more than one grouping variable
gscatter will accept multiple grouping variables, in your case organism & dead/alive. There is an example in the gscatter docu...

oltre 2 anni fa | 0

| accettato

Risposto
Distribute a sum using binomial distribution
If I understand correctly, it is fine to use binornd with n = row total. It sounds like that is what was done in the paper. j...

oltre 2 anni fa | 0

Risposto
Why is fitlm affected by variable scale?
Your understanding is correct for linear regression but your model is nonlinear because of the interaction terms. Consider: zX ...

oltre 2 anni fa | 0

Risposto
understanding Linear regression model equation after simplifying.
I think the notation y~ 1+ x1*x2 is shorthand for y~ 1*b0+ b1*x1 + b2*x2 + b3*x1*x2. The four b values are the four estimates...

oltre 2 anni fa | 0

| accettato

Risposto
Is there a way to normalizing a probability density function / keep the density values between 0 and 1?
Dividing by the max density value would have the unfortunate ramification that the resulting function would no longer be a densi...

oltre 2 anni fa | 0

| accettato

Risposto
plot of log likelihood values
I think this might be what you are after: x = [2 4 3 1 6 2 2.5 7 10]; % data ShapeCandidates = 1:10; Scale = 6; loglik...

oltre 2 anni fa | 0

Risposto
How can I see specific likelihood values with MLE (or possibly another function?)
Once you have the parameter estimates (e.g., from mle) you can compute the likelihood value by calling your custom density funct...

oltre 2 anni fa | 0

Risposto
Facing an error while using 'anovan' function
anovan needs the original data (y1 and y2) to compute an error term, but you are only giving it the averages (ybar). This is why...

oltre 2 anni fa | 0

| accettato

Risposto
Generating random variable from inverse gaussian dist.
Do you really need to write the random generator yourself? This one is already available: >> pd = makedist('inversegaussian') ...

oltre 2 anni fa | 0

Risposto
How do I get MATLAB to display the d' when my hit rate = 1 using the norminv function?
No, d' cannot be computed when an observed hit_rate is 1 or fa_rate is zero. One of the most common work-arounds for this probl...

oltre 2 anni fa | 0

Risposto
How to delete some of anonymous variables randomly?
One way to approach the problem is to write a function f(x) where x is a vector with 47 positions. When you call f, put numeric...

oltre 2 anni fa | 0

| accettato

Risposto
Random Laplacian distribution in a specified interval
Here is a quick and dirty way to do this with Cupid: location = 0; % set whatever Laplacian parameters you want. scale = 1; ...

oltre 2 anni fa | 0

| accettato

Risposto
kstest for uniform distribution
you can test for the fit of a discrete distribution, including uniform, with chi2gof. One of the examples (about 1/3 of the way...

oltre 2 anni fa | 1

| accettato

Carica altro