Answered
Having trouble understanding what the "[]" command in min(X,[],1) does. Can anyone help?
First, the *|‘[]’|* is used the stand in for an unspecified argument in a function argument list. Functions generally have thei...

9 years ago | 1

| accepted

Answered
100 Random numbers given t-distribution with mu = x% std = y% and df = 100?
The <https://www.mathworks.com/help/stats/trnd.html *|trnd|*> (link) function does not allow you to specify a mean and standard ...

9 years ago | 0

Answered
Memorize Initial Position of Columns in a Matrix
Do all the swaps at one time: A = [1 -1 1 0 0; 2 -1 0 1 0; 0 1 0 0 1]; Aswap = A(:,[5,4,1,2,3]) That will give you t...

9 years ago | 0

Answered
How to solve standard normal distribution function for unknown variable.
It _seems_ that your ‘beta’ values are actually _z_-scores, since the standard normal distribution requires _two_ parameters, th...

9 years ago | 0

| accepted

Answered
Using Randperm between two values
Try this: NextRequirement = 60 + randperm(15, 8)

9 years ago | 2

Answered
How to insert words in between tick marks on the X-axis
Use the <https://www.mathworks.com/help/matlab/ref/text.html *|text|*> (link) function to create the labels. Experiment to ...

9 years ago | 0

Answered
how to find a specific contour line out of the contour lists
If you are specifying the contours, you already have the levels. If you do not specify them in your code (as you have for the *...

9 years ago | 1

Answered
Construct income distributions from parameters knowledge
I am not certain of the result you want. One possibility would be to use the *|lognrnd|* function to create random numbers ...

9 years ago | 1

Answered
noise production in matlab
To create band-limited noise, design a filter with the desired sampling frequency (that for a *|500|* Hz cutoff frequency must b...

9 years ago | 1

| accepted

Answered
How can I omit a column from a mean of a row?
If *|‘A’|* and *|‘B’|* are your arrays, try this: CC = corrcoef(A(:,[1:7, 9:end]), B(:,[1:7, 9:end])); That is probably...

9 years ago | 0

Answered
Plotting a function and a horizontal line segment
Try this: f = @(x) exp(x) - log(x+0.01); x2nd = fzero(@(x) f(x)-f(0), 5); % Find Second ‘x’ At ‘...

9 years ago | 0

Answered
How can I start the y axis of my plot with 1 but keep increments at 5, 10, 15 and so on?
Without your data, writing specific code to do what you want can be difficult. Try this: x = 0:100; ...

9 years ago | 0

Answered
How to solve for multiple unknowns in a kinetic model
See <http://www.mathworks.com/matlabcentral/answers/43439-monod-kinetics-and-curve-fitting *Monod kinetics and curve fitting*> (...

9 years ago | 0

| accepted

Answered
Solve a system of ODEs with multiparameter nonlinear regression
For a relevant example, see <http://www.mathworks.com/matlabcentral/answers/43439-monod-kinetics-and-curve-fitting *Monod kineti...

9 years ago | 0

| accepted

Answered
Matrix one column separation into several columns with same amount of data
Use the <https://www.mathworks.com/help/matlab/ref/reshape.html *|reshape|*> (link) function. YourReshapedMatrix = reshap...

9 years ago | 0

Answered
How can I make a scaled image of this data?
Your data are actually gridded, so all you need to do is to reshape the three columns. Then you can use *|contour|*, *|contourf...

9 years ago | 0

| accepted

Answered
How to calculate the area of an input image?
If it is a binary image (so a 2D array), the <https://www.mathworks.com/help/matlab/ref/numel.html *|numel|*> (link) function wi...

9 years ago | 1

| accepted

Answered
How to get the phase sift of the filtering?
The only way I can see to calculate this is to filter the same signal using *|filter|* and *|filtfilt|*, then compare them with ...

9 years ago | 0

Answered
Fit frequency-domain data of quartz oscillator
You may not be specifying your model correctly for *|tfest|*. Note that in addition to two non-zero finite zeros and two non-ze...

9 years ago | 0

Answered
How to use ROC FUNCTION in MATLAB
They apparently need to be _row_ vectors. (I found the documentation a bit confusing, but then I do not use these functions fre...

9 years ago | 2

| accepted

Answered
I have 5*10*9000 matrix. how can I average each 5*10 slices to get 9000 * 1 matrix. Please any helper? thanks
See if this does what you want: M = rand(5,10,9000); % Create Data MR = reshape(M, [], size(...

9 years ago | 0

| accepted

Answered
I am trying to extract data from a .csv file that contains a header but I keep getting an empty array in return.
Try this: [D,S] = xlsread('TCData_1.csv'); DataCell = cellfun(@(x)str2double(regexp(x, ',', 'split')), S(9:end), 'Uni',...

9 years ago | 1

| accepted

Answered
Zero-crossing calculation
This is reasonably robust: function ZC = ZeroX(x,y) zci = @(v) find(v(:).*circshift(v(:), [-1 0]) <= 0); ...

9 years ago | 2

| accepted

Answered
Does matlab have a function that says "If zero is near?
There is not built-in MATLAB function for that. It is possible to create one easily enough: nearZero = @(x,tol) abs(x...

9 years ago | 3

Answered
error unexpected matlab expression
In MATLAB, the multiplication is the asterisk |‘*’|, not a dot *|‘.’|*. If you want to do element-wise operations, use the ...

9 years ago | 0

| accepted

Answered
Why does the plot of Fourier Trasformed pressure with monofrequent excitation show high peaks in the beginning and at the end of the x-axis?
I _suspect_ that you are plotting the entire length of the Fourier transform result. The ‘peaks’ at the extremes are the consta...

9 years ago | 0

| accepted

Answered
changing the running variable in a "for" loop
You cannot change the loop index variable within a *|for|* loop: n = n + dt/delta_t+1; Since *|‘n’|* is going to increm...

9 years ago | 0

Answered
How to load in a matrix and get means of certain cells?
There are several functions available to read your data, depending on the file format. See the documentation on *|load|*, <http...

9 years ago | 0

| accepted

Answered
Solving an equation with integral with one variable
If I understand correctly what you want to do, this works: f = @(x) exp(x.^2) .* x.^2; Cs = fzero(@(C) C + integral(f, ...

9 years ago | 2

Answered
specify rows and columns to find min value?
This works: N = [0 1 5 12 1; 1 23 4 75 5; 11 29 2 5 9; 23 3 5 8 0; 12 11 23 48 0]; RC = [1 3; 2 5; 2 3; 5 1; 2 4; 1 1; ...

9 years ago | 0

| accepted

Load more