Answered
Randomly select values from a vector that yield a target mean
Well, this is pretty ugly, but you could just repeatedly sample N numbers from AR randomly, stopping when they give you TM. Tha...

8 years ago | 0

Answered
Matlab PDF testing for integers only
Thanks for your clarification. Well, if adtest, etc, won't let you specify the points at which to examine the distributions (...

8 years ago | 0

Answered
Fit Experimental Data to a Predetermined Model
If I understand you correctly, you might proceed by trial and error, using different combinations of nstar/hshift until you get ...

8 years ago | 0

Answered
how to use anonymous functions
x = 1:100; a = [1,5,2.5]; gau = @(x,a)(a(1).*exp(-0.5.*((x-a(2)).^2./a(3).^2))); m1 = gau(x,a)

8 years ago | 1

Answered
Parfor Loop Help: Classification of Variables
Can't you replace j with idx (and get rid of j=j+1)? The problem is that MATLAB does know which row of amp and loc should recei...

8 years ago | 1

Answered
How to Create Libraries in Matlab?
Another option is to combine the functions into a single class, making them static functions so that you don't need to instantia...

8 years ago | 5

Answered
Generate pair of random numbers with respect to a sum constraint?
It isn't entirely clear what joint distribution you want for (x,y), but here is one possibility: x = rand; % uniform...

8 years ago | 0

Answered
Run the same code with multiple variables.
It might be convenient to store each of the 10-20 matrices as one cell in a cell array, since that doesn't require that they hav...

8 years ago | 0

| accepted

Answered
Combine multiple if statements for something more compact
Maybe something like this: IGVals = [3.78 2.06 1.58 1.21 0.82]; CurrentIG = 1; i=1; while (VMPH<=60) ... ...

8 years ago | 0

| accepted

Answered
Optimization of function with constraints having products of variables
From your two constraints, it looks like p2 and p3 are completely determined by the other variables. If so, just optimize the s...

8 years ago | 3

Answered
Extract data from a .txt file
This function loads all of the numbers into one big long list. You can then grab out the numbers you want if you know their seq...

8 years ago | 0

Answered
I am getting conflicting results for probplot with weibull and censors. Is there some pre-processing going on in the back-ground that I am unaware of. This is when compared to Minitab.
I don't think probplot does any fitting. If not, your probplot command would just plot your data against a Weibull with the defa...

8 years ago | 0

Answered
Plotting data in mat lab based on a certain criteria
If you convert your data into MATLAB's table format, <https://au.mathworks.com/matlabcentral/fileexchange/64581-milleratotago-pl...

8 years ago | 0

| accepted

Answered
Error when using fitrm - Fit Repeated Measures Model for RM ANOVA
This seems like a slightly nonstandard problem to me so I am not sure, but here is one way you might approach it. measureme...

8 years ago | 1

Answered
How do I create a table from a for loop?
One possibility is to store the results in arrays as you go, then stuff them all into a table at the end. Something like this, ...

8 years ago | 0

| accepted

Answered
Why is cumsum producing CDF>1 values from a user defined distribution?
I think the problem is that the pdf is decreasing. Note that cumsum(paretoPDF).*dx approximates each segment of the PDF with th...

8 years ago | 0

Answered
How can I display questions(one by one) on the screen from txt file ?(When using Psychtoolbox)
Unless you really have to collect these responses in PsychToolbox, you might be able to use http://www.mathworks.com/matlabcentr...

8 years ago | 0

Submitted


milleratotago/ExtractNameVal
Tools for passing optional parameters and name/value pairs in MATLAB.

8 years ago | 1 download |

0.0 / 5

Submitted


fminsearcharb
Function to minimize an error function with constrained and/or integer parameters

8 years ago | 1 download |

4.0 / 5

Answered
How to acces multiple fields of a structure at the same time?
How about just this? result = [test.a test.c];

8 years ago | 3

Answered
One-tailed test using the ranksum function
Yes, there is an explanation. The flaw is in your intuition (which I admit is very compelling) that "the value of h should be e...

8 years ago | 0

| accepted

Answered
Generate a vector "b" from an already defined vector "B" several times but taking different elements of "A" each time
idx=reshape(randperm(4425),15,295); b = reshape(B(idx(:)),15,295); The 15 rows of b are the 15 new vectors, and idx hold...

8 years ago | 0

| accepted

Answered
fit a curve with smallest distance in y AND x direction to data points
It sounds like you want *"orthogonal linear regression"*. See <https://www.mathworks.com/matlabcentral/fileexchange/16800...

8 years ago | 1

| accepted

Answered
How to fit data (x,y) with log-normal distrubition and not constant mu and sigma
I am still not sure that I understand the question, so let me summarize my interpretation: You have a set of (x_i,y_i). For ...

8 years ago | 0

Answered
How to fit data (x,y) with log-normal distrubition and not constant mu and sigma
I do not understand what you mean when you say, "I want to fit a data (x_i,y_i) using lognormal distrubition". To "fit" usual...

8 years ago | 0

Answered
Minimize error of linear regression by changing input x-vector
If you want to predict kWh from tc and ty, you might simply use the 2-predictor linear regression model kWh = a + b1*tc + b2*ty....

8 years ago | 0

Answered
How do I randomly generate multiple random shapes within a given area WITHOUT overlapping?
One very general way is to just keep generating shapes randomly but throw away any newly-generated random shapes that overlap wi...

8 years ago | 0

| accepted

Answered
How to pseudo-randomize the ordering of a vector?
One approach is to think of your data, A, as being column one of a 2-column array (e.g., 10x2). Now generate pseudo-random numb...

8 years ago | 1

| accepted

Answered
How to construct a Sliced Reduction Variable in MALTAB parallel for loop
Maybe something like this? k = cell(N,1); u = cell(N,1); parfor i = 1:N k{i} = ... % k is a matrix of dimen...

8 years ago | 0

Question


How can I control the format of the tick label numbers when using a log YScale with a large range?
I am trying to produce plots with a log Y-axis scale and with non-exponential format numbers (e.g., 1000, not 10^3) as labels fo...

8 years ago | 1 answer | 1

1

answer

Load more