Respondida
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;...

más de 13 años hace | 0

| aceptada

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

más de 13 años hace | 0

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

más de 13 años hace | 0

Respondida
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)

más de 13 años hace | 0

| aceptada

Respondida
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...

más de 13 años hace | 0

| aceptada

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

más de 13 años hace | 1

| aceptada

Resuelto


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...

más de 13 años hace

Resuelto


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...

más de 13 años hace

Resuelto


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

más de 13 años hace

Resuelto


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...

más de 13 años hace

Resuelto


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

más de 13 años hace

Respondida
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...

más de 13 años hace | 0

Respondida
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...

más de 13 años hace | 1

| aceptada

Respondida
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-...

más de 13 años hace | 0

Respondida
peak of a graph
help findpeaks

más de 13 años hace | 0

Respondida
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...

más de 13 años hace | 0

| aceptada

Respondida
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...

más de 13 años hace | 0

Respondida
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...

más de 13 años hace | 0

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

más de 13 años hace | 0

| aceptada

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

más de 13 años hace | 1

| aceptada

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

más de 13 años hace | 0

Respondida
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)

más de 13 años hace | 0

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

más de 13 años hace | 0

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

más de 13 años hace | 1

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

más de 13 años hace | 0

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

más de 13 años hace | 0

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

más de 13 años hace | 0

| aceptada

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

más de 13 años hace | 0

Respondida
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...

más de 13 años hace | 0

Respondida
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 ...

más de 13 años hace | 1

| aceptada

Cargar más