Réponse apportée
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;...

plus de 13 ans il y a | 0

| A accepté

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

plus de 13 ans il y a | 0

Réponse apportée
Clustering the image using k means
In your example, use kmeans(r, number_of_clusters)

plus de 13 ans il y a | 0

Réponse apportée
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)

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

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

plus de 13 ans il y a | 1

| A accepté

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
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-...

plus de 13 ans il y a | 0

Réponse apportée
peak of a graph
help findpeaks

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
how to shift arrays to the right??
arr = [round(rand(1,1)) arr];

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Insert data in a cell
for i = 1:numel(length) f{i, 3} = length(i); end

plus de 13 ans il y a | 1

| A accepté

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

plus de 13 ans il y a | 0

Réponse apportée
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)

plus de 13 ans il y a | 0

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

plus de 13 ans il y a | 0

Réponse apportée
Insert data in a cell
f{2, 3} = length;

plus de 13 ans il y a | 1

Réponse apportée
choose the 3 first lowest number in the cell after it sorted
[f{end-2:end, :}]

plus de 13 ans il y a | 0

Réponse apportée
how to define the following function
if 0 <= x && x <= pi, y = 0; end

plus de 13 ans il y a | 0

Réponse apportée
Print to file a cell array of struct
save('myfile.mat', myCell)

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
how to Sorting a cell?
[sorted ind] = sort([f{:, 1}]); f = f(ind, :)

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
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 ...

plus de 13 ans il y a | 1

| A accepté

Charger plus