Answered
K-means algorithm document
Please look at the documentation. <http://www.mathworks.com/help/stats/kmeans.html> Copy/pasting from there: *Referenc...

11 years ago | 0

| accepted

Answered
Plotting filled markers with colors
b = bone(64);

11 years ago | 1

| accepted

Answered
How to plot MESH only in black?
You could set the _colormap_ to black only, and use surf instead. [x,y] = meshgrid([-2:.2:2]); Z = x.*exp(-x.^2-y.^2); ...

11 years ago | 1

Answered
interpolation vector with a lot of duplicate values
If there are several values for one coordinate, then you could, e.g. take the mean value of the abscissas for that coordinate an...

11 years ago | 3

| accepted

Answered
How can I load GDS II into matlab?
# The hard way: find out how the GDSII binary is structured and read it directly into Matlab. # The compromise way: Use a GDSII...

11 years ago | 0

| accepted

Answered
How do I loop through files saved in my workspace?
RA_1002_timecourse = rand(10); RA_893_timecourse = rand(10); %list variables in workspace myVars = whos; ...

11 years ago | 0

Answered
can this loop be vectorized?
_bsxfun()_ is your friend: X = repmat(0:5:1000,201,1); Y = repmat((1000:-5:0)',1,201); x(1,1,1:3) = [50 326 800];...

11 years ago | 1

Answered
How to use box plots for irregular x-axis intervals?
You can't. At least not if you use the _boxplot()_ function. You'd have to create your own variant. Alternatively you could cre...

11 years ago | 1

Answered
Read Multiple Images from a Folder
http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F

11 years ago | 0

| accepted

Answered
Generate automatically vectors of precise length and given values
vector_2 = [1,100,2,100,3,100,4]; numVal = 19; your_vec = repmat(vector_2,1,ceil(numVal/numel(vector_2))); your_vec =...

11 years ago | 1

| accepted

Answered
HOW CAN I RE-EDIT MATRIX?
your_mat = cell2mat(arrayfun(@(n) repmat(a(n,[1 3]),a(n,2),1),(1:size(a,1))','uniformoutput',false));

11 years ago | 1

| accepted

Answered
What is the maximum number of variables for practical use of fminsearch?
The Nealder-Mead algorithm is meant to be used for low-dimensionality problems. _fminsearch_ uses it. Please see: [1] Laga...

12 years ago | 1

| accepted

Answered
How to merge cells together?
Two alternatives, since I am not exactly sure what you want. a = num2cell(randi(10,10,10)); your_mat = cell2mat(a); ...

12 years ago | 0

| accepted

Answered
I need to manipulate this matrix
B = reshape(A',1,[]); Alternatively: B = A'; B = B(:);

12 years ago | 0

| accepted

Answered
To order min to max value for matrix's row
sortrows(sort(a,2))

12 years ago | 0

| accepted

Answered
intersection between three circles
If you have the mapping toolbox, then _circcirc()_ works for two circles at a time (in your case you would have to test the thre...

12 years ago | 0

Answered
Problems with rand() when tossing coin
Simplifying your code a bit: vals = rand(1000,1)>0.5; ratio = sum(vals)/sum(~vals); What makes you thing the results a...

12 years ago | 0

Answered
remove values of a matrix from another
A = A(~ismember(A,B))

12 years ago | 1

| accepted

Answered
fscanf returns an empty array
doc memmapfile

12 years ago | 0

| accepted

Answered
how to control and access which variables are considerent at each iteration in ga optimization?
I might be mistaken, but that's not how I would go about doing sensitivity analysis. It sounds to me that all you'd be achieving...

12 years ago | 0

Answered
Write a function for calculate value
doc min doc max doc mean doc varargin

12 years ago | 0

Answered
Mean and median (difference)
With only two values, there is no difference. If the values come from a normal distribution, there is no difference. If th...

12 years ago | 0

| accepted

Answered
How to calculate mean wind direction
average = mod(sum(data),360)./numel(data) Please accept an answer if it helped you.

12 years ago | 1

| accepted

Answered
sum first and last number of array
To give you a hint: a = randi(10,10,1); your_mat = sum([a flipud(a)],2); Modify to fit your criteria. Please accept...

12 years ago | 1

Answered
Find the first position of maximum value in a Matrix
[maxValue, linearIndexesOfMaxes] = max(A(:)); [rowsOfMaxes colsOfMaxes] = find(A == maxValue,1,'first') Please accept an...

12 years ago | 1

| accepted

Answered
Splitting array into two
s1 = x(1:half); s2 = x(half + 1 : end); Indexing starts at one in Matlab. Please accept an answer if it helped you.

12 years ago | 5

| accepted

Answered
how to draw 3 2D plots concurrently with their 3D plot in the same image
You could use _plot3()_ and consecutively set one of the coordinates as a constant. data = repmat((1:10)',1,3); plot3(...

12 years ago | 1

| accepted

Answered
x = 0:0.1:10... What's going on, really?
Well, just look at how _linspace_ is implemented: edit linspace It might explain some of the behavior you see. On an addi...

12 years ago | 0

| accepted

Answered
What is the best way to execute 2 if conditions in MATLAB
for ii = 1:numel(w) if (w(ii) == 1) %stuff else if (q(ii) == 1) %stuff else ...

12 years ago | 0

| accepted

Answered
columns, none under 5.
One of many, many possible ways: a = [1 0 0 1 1 0 2 0 2 0 3 3 4 1 4 0 7 1 7 2 ... 9 1 6 3 7 2 10 1 10 3 8 1 10 6 13 ...

12 years ago | 0

| accepted

Load more