Answered

sorting array without min and max

Take your pick: Sorting algorithms Enjoy this video as well.

sorting array without min and max

Take your pick: Sorting algorithms Enjoy this video as well.

22 días ago | 0

Answered

Count number of times value appears in column

% Parameterize the max value, for convenience V = 296; % Some simulated data FinalRanking = randi(V,1000,V); % Prealloca...

Count number of times value appears in column

% Parameterize the max value, for convenience V = 296; % Some simulated data FinalRanking = randi(V,1000,V); % Prealloca...

22 días ago | 1

| accepted

Answered

Generating random number for the Inverse Gaussian distribution

If you have the Statistics and Machine Learning Toolbox, then you can generate N random numbers with N = 1000; % Set this to th...

Generating random number for the Inverse Gaussian distribution

If you have the Statistics and Machine Learning Toolbox, then you can generate N random numbers with N = 1000; % Set this to th...

22 días ago | 0

| accepted

Answered

Understanding standard deviation code

As explained clearly in the documentation for std: The "0" specifies that the standard deviation will be weighted by sqrt(N-1),...

Understanding standard deviation code

As explained clearly in the documentation for std: The "0" specifies that the standard deviation will be weighted by sqrt(N-1),...

22 días ago | 2

Answered

Undefined function 'niftiread'

niftiread is a function from the Image Processing Toolbox. Do you have that toolbox installed and licensed?

Undefined function 'niftiread'

niftiread is a function from the Image Processing Toolbox. Do you have that toolbox installed and licensed?

23 días ago | 0

Answered

How to concatenate cell array without causing nested cell array

% Input data years = [2007 2008 2005 2006 2007 2008 2005 2006 2007 2008]; % Initialize the first cell with the first year c...

How to concatenate cell array without causing nested cell array

% Input data years = [2007 2008 2005 2006 2007 2008 2005 2006 2007 2008]; % Initialize the first cell with the first year c...

23 días ago | 0

| accepted

Answered

Insert Interpolation Into Matlab Code

Here is my best guess at what you should do, to get what you want: Take the x argument out of the call to interp1 Change the d...

Insert Interpolation Into Matlab Code

Here is my best guess at what you should do, to get what you want: Take the x argument out of the call to interp1 Change the d...

23 días ago | 0

| accepted

Answered

MatLab PCA-LDA Code

If you have the Statistics and Machine Learning Toolbox, then you can use the built-in pca function. I'm not sure what you mean...

MatLab PCA-LDA Code

If you have the Statistics and Machine Learning Toolbox, then you can use the built-in pca function. I'm not sure what you mean...

23 días ago | 0

Answered

How to generate rayleigh random variables with specified mean value having minimum value?

If you have the Statistics and Machine Learning Toolbox, then you can generate n Rayleigh-distributed random numbers using the r...

How to generate rayleigh random variables with specified mean value having minimum value?

If you have the Statistics and Machine Learning Toolbox, then you can generate n Rayleigh-distributed random numbers using the r...

23 días ago | 0

| accepted

Answered

How can I add line of best fit into my subplots. I have tried to use polyfit but it doesn't work.

As stated in the polyfit documentation, it requires three inputs. (The third input is the degree of the fitting polynomial.) Yo...

How can I add line of best fit into my subplots. I have tried to use polyfit but it doesn't work.

As stated in the polyfit documentation, it requires three inputs. (The third input is the degree of the fitting polynomial.) Yo...

23 días ago | 0

Answered

Getting an error message and don't know how to fix

abs(v) is a vector, so the right-hand side is a vector. You are trying to put that into one element of v on the left-hand side....

Getting an error message and don't know how to fix

abs(v) is a vector, so the right-hand side is a vector. You are trying to put that into one element of v on the left-hand side....

24 días ago | 0

| accepted

Answered

Randomly changing a value of a matrix

M = zeros(5,5); M(randi(25)) = 1; This algorithm takes advantage of the power of linear indexing.

Randomly changing a value of a matrix

M = zeros(5,5); M(randi(25)) = 1; This algorithm takes advantage of the power of linear indexing.

24 días ago | 0

| accepted

Answered

find the σ and the μ of the lognormal function, having 1st percentile and the 99th percentile

First you need to understand the math problem, then you can use MATLAB to solve numerically. You can find the CDF of the lognor...

find the σ and the μ of the lognormal function, having 1st percentile and the 99th percentile

First you need to understand the math problem, then you can use MATLAB to solve numerically. You can find the CDF of the lognor...

24 días ago | 1

| accepted

Answered

is there a way to flip an array

Yes, the transpose command. xt = x.'; % or xt = transpose(x);

is there a way to flip an array

Yes, the transpose command. xt = x.'; % or xt = transpose(x);

24 días ago | 0

Answered

Find histogram bins at which cumulative histogram has 75% of maximum value

You don't give much detail. Do you have the underlying data, or just the counts from the histogram bins? If you have the data, ...

Find histogram bins at which cumulative histogram has 75% of maximum value

You don't give much detail. Do you have the underlying data, or just the counts from the histogram bins? If you have the data, ...

25 días ago | 1

| accepted

Answered

Combining two tables from different years. Find the duplicates through key column.

Sounds like you could use the ismember command.

Combining two tables from different years. Find the duplicates through key column.

Sounds like you could use the ismember command.

25 días ago | 1

Answered

Nested Loops Not Changing with Time

Nothing in your inner for loop depends on n. Things depend on N. So it looks like that inner loop just does the same calculation...

Nested Loops Not Changing with Time

Nothing in your inner for loop depends on n. Things depend on N. So it looks like that inner loop just does the same calculation...

25 días ago | 0

Answered

Counting consecutive repeat values for each row in matrix

First, I would download Jan's RunLength utility from the File Exchange, which was designed to solve exactly this kind of problem...

Counting consecutive repeat values for each row in matrix

First, I would download Jan's RunLength utility from the File Exchange, which was designed to solve exactly this kind of problem...

25 días ago | 1

| accepted

Answered

Working with 1d vector sequences

Still fairly brute-force, but here is a little function that will pad a row or column vector, retaining the orientation: functi...

Working with 1d vector sequences

Still fairly brute-force, but here is a little function that will pad a row or column vector, retaining the orientation: functi...

26 días ago | 0

Answered

Working with 1d vector sequences

v = v(:); will be a column vector regardless of whether it came in as a row or column vector. So, you could "pre-process" your ...

Working with 1d vector sequences

v = v(:); will be a column vector regardless of whether it came in as a row or column vector. So, you could "pre-process" your ...

26 días ago | 0

Answered

If I develop a function faster than Matlab built-in function...

First, I would submit it to the File Exchange. Then, I guess you could contact support, using the little icon of the telephone ...

If I develop a function faster than Matlab built-in function...

First, I would submit it to the File Exchange. Then, I guess you could contact support, using the little icon of the telephone ...

26 días ago | 0

Answered

Plotting planets in MATLAB

You have given very little detail about how your data are stored. There are a few possible ways, depending on that. % Pretend d...

Plotting planets in MATLAB

You have given very little detail about how your data are stored. There are a few possible ways, depending on that. % Pretend d...

26 días ago | 0

Answered

Display Markers At Specific Data Points

The marker indices functionality was introduced in version R2106b. If you have an older version, then you'll get an error. You ...

Display Markers At Specific Data Points

The marker indices functionality was introduced in version R2106b. If you have an older version, then you'll get an error. You ...

26 días ago | 1

Answered

Return rank value of a row

Here is another solution: [~,rank] = ismember(Sscore,sort(Sscore,'desc'));

Return rank value of a row

Here is another solution: [~,rank] = ismember(Sscore,sort(Sscore,'desc'));

27 días ago | 1

Answered

Return rank value of a row

[~,idx] = sort(Sscore,'desc'); [~,rank]= sort(idx)

Return rank value of a row

[~,idx] = sort(Sscore,'desc'); [~,rank]= sort(idx)

27 días ago | 1

| accepted

Answered

Using find command to find bifurcation points

Here is a loglog plot of the difference between M(1,:) and M(2,:). I think what you are actually trying to do is find the f...

Using find command to find bifurcation points

Here is a loglog plot of the difference between M(1,:) and M(2,:). I think what you are actually trying to do is find the f...

27 días ago | 0

| accepted

Answered

Compare two arrays (intersection) and create new array with output columns, but with repetitions

It's a little convoluted, but this should work: A = [1 3500, 2 100, 2 564, 3 2140, 3 9820, 2 8952] B = [1 0 0 0.5, 2 0 0 0.8, ...

Compare two arrays (intersection) and create new array with output columns, but with repetitions

It's a little convoluted, but this should work: A = [1 3500, 2 100, 2 564, 3 2140, 3 9820, 2 8952] B = [1 0 0 0.5, 2 0 0 0.8, ...

27 días ago | 0

Answered

How to rearrange the output variables for matlabFunction()?

I don't know the answer to your sorting question. However, pulling back to the big picture for a moment, it seems like storing ...

How to rearrange the output variables for matlabFunction()?

I don't know the answer to your sorting question. However, pulling back to the big picture for a moment, it seems like storing ...

27 días ago | 0

Answered

Matrix manipulation Question - arranging rows

sortrows(a,1) See the documentation for sortrows for details.

Matrix manipulation Question - arranging rows

sortrows(a,1) See the documentation for sortrows for details.

28 días ago | 0