Answered
Sorting large vector onto 2D grid
sz = [360 720]; ind_list = sub2ind(sz, row, col); for i = 1:360 for j = 1:720 index = 360*(j - 1) + i;...

13 years ago | 0

| accepted

Answered
Sorting large vector onto 2D grid
sz = [360 720]; ind = sub2ind(sz, row, col); values = zeros(sz); values(ind) = meas;

13 years ago | 0

Answered
Clustering the image using k means
In your example, use kmeans(r, number_of_clusters)

13 years ago | 0

Answered
How can I write and save *.txt file by the *.m file in the specific path like C:\folder1\rio.txt
fid = fopen('C:\folder1\rio.txt', 'w'); fprintf(fid, '%s', '0123456789'); fclose(fid)

13 years ago | 0

| accepted

Answered
plotting information that is above a certain threshold
If you want to plot the data above threshold, you can use dataset_new = dataset(find(dataset > 100)); plot(dataset_new...

13 years ago | 0

| accepted

Answered
how to create a transparent sphere
[x y z] = sphere(128); h = surfl(x, y, z); set(h, 'FaceAlpha', 0.5) shading interp

13 years ago | 1

| accepted

Solved


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

13 years ago

Solved


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

13 years ago

Solved


Is my wife right?
Regardless of input, output the string 'yes'.

13 years ago

Solved


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

13 years ago

Solved


Add two numbers
Given a and b, return the sum a+b in c.

13 years ago

Answered
manually specify occourrences in bar graph
Sample values values = [1:4]; entropy = [1.8 1.9 2.1 2.2]; bandwidth = [18 2 10 11]; Plot the bars h = bar(va...

13 years ago | 0

Answered
Store a number of calculations within a matrix
Store all results in variable R i = 1; while(time<1) R(i, 1 ) = time; R(i, 2) = Velocity(mass, viscosity...

13 years ago | 1

| accepted

Answered
Loop step size issue
This runs about 4 times faster on my machine: cS = cumsum(S); for K = 1 : ni sums = cS(ivals(K):end) - [0 cS(1:end-...

13 years ago | 0

Answered
peak of a graph
help findpeaks

13 years ago | 0

Answered
Need help with my image processing about circle detection
sigma = 5; % Gaussian smoothing, adapted to the size of the eggs thres = 0.9; % binary threshold, adapted to the brightness...

13 years ago | 0

| accepted

Answered
Loop step size issue
Walter's solution is more efficient. If you want to do it quick Output = nan(1, 100); % your code here Output = O...

13 years ago | 0

Answered
How to select files in a directory
% run once for, see if the 'move file' output is ok % if ok, uncomment the movefile line such that the files are actually m...

13 years ago | 0

Answered
how to shift arrays to the right??
arr = [round(rand(1,1)) arr];

13 years ago | 0

| accepted

Answered
Insert data in a cell
for i = 1:numel(length) f{i, 3} = length(i); end

13 years ago | 1

| accepted

Answered
If condition to check for contact of two balls
You forgot the "x = " in the third row. Should read x = get(h2(2), 'xdata');

13 years ago | 0

Answered
hello, i m new to matlab,,, plz help me ....how can we divide an image into overlapping blocks?
If your have a function FUN to be applied to each block, you can use B = nlfilter(A, [M N], FUN)

13 years ago | 0

Answered
choose the 3 first lowest number in the cell after it sorted
reshape({f{end-2:end,:}}, [3 3])

13 years ago | 0

Answered
Insert data in a cell
f{2, 3} = length;

13 years ago | 1

Answered
choose the 3 first lowest number in the cell after it sorted
[f{end-2:end, :}]

13 years ago | 0

Answered
how to define the following function
if 0 <= x && x <= pi, y = 0; end

13 years ago | 0

Answered
Print to file a cell array of struct
save('myfile.mat', myCell)

13 years ago | 0

| accepted

Answered
how to Sorting a cell?
[sorted ind] = sort([f{:, 1}]); f = f(ind, :)

13 years ago | 0

Answered
Problems with calculating Second derivative and SG smoothing
diff(x, 2) is just one way to numerically approximate the derivative. Origin may use a different method. The result by Origi...

13 years ago | 0

Answered
Simulating using random orthogonal matrices. How can i create a massive matrix from an equation containing several random matrices and fixed matrices?
for i = 1:N M = ... Q = ... L = ... R = ... An = ... if i == 1 X = M*Q*L*R*An; else ...

13 years ago | 1

| accepted

Load more