Answered
HOW TO MOVE THE DIAGONAL ELEMENTS IN MATRIX (ONE PIXELS) FOR IMAGE PROCESSING
I = [ 1 4 6 8 2 3 7 9 5]; % initial array idx = reshape(1:numel(I),size(I...

14 years ago | 1

| accepted

Answered
Setting X as a column of a matrix
M = [1, 80.8 %A Matrix for the grades 2, 79 3, 87.4 4, 74.2 5, 82 6, 85]; x = cellstr(['F';('D':-1:'A')'...

14 years ago | 0

Answered
Method to compound daily data by n-days?
I = 1:6; % The initial array out = nonzeros(prod(reshape([I,zeros(1,mod(-numel(I),n))],n,[])))';

14 years ago | 0

Answered
Adding vectors in Matlab
mod1= [413 443 467 487 531 547 648 666 677 747 859 867 905 936 1388 1631 2121]'; lan1= [485 560 660 815 1650 2215]'; mo...

14 years ago | 0

| accepted

Answered
HOW TO MOVE THE DIAGONAL ELEMENTS IN MATRIX (ONE PIXELS) FOR IMAGE PROCESSING
I = [1 2 4 2 5 6 1 3 8 ]; ii = 1:size(I,1)+1:numel(I); I(ii) = I(ii(mod(ii - 2,3)+1)); or I(eye(size(I))>0...

14 years ago | 1

| accepted

Answered
speed up a matlab code by replacing inv(X)*Y with X\Y in 3D dimensions
A = 380; B = 380; C = 200; X = rand(A,B,C) + 1i*rand(A,B,C); Y = rand(A,1) + 1i*rand(A,1); Z = zeros(A,C); ...

14 years ago | 1

Answered
how to extract time after calculating mean and standard deviation?
please try this is code (corrected) f = fopen('yourdata.txt'); c = textscan(f,'%s %s %f %f %f %f','HeaderLines',1,'Colle...

14 years ago | 1

| accepted

Answered
To pick a number randomly
try this is code A=[1 2 3 4 5; 6 6 7 5 8 ; 12 4 5 6 9]; a = unique(A); b = a(histc(A(:),a) < 2); idx = randperm(nu...

14 years ago | 1

| accepted

Answered
Finding same combination from two results
A = {result;result1}; [i0,i0] = sort(cellfun(@numel,A),'descend'); [m1,n1] = cellfun(@size,result); [m2,n2] = cellfun...

14 years ago | 0

| accepted

Answered
Converting a matrix of other forms into one simple matrix - help
please read about the function <http://www.mathworks.com/help/techdoc/ref/reshape.html |reshape|> A = randi(456,4,36,4); ...

14 years ago | 1

| accepted

Answered
how to find the equality of 2 numbers?
AE = [a e]; %The initial array out = AE(abs(diff(AE,1,2)) < eps(100),:);

14 years ago | 1

| accepted

Answered
Cell and String manipulation
a0 = cellstr(('1':'3')'); a1 = {'';'i'}; [i1,i2]=ndgrid(1:3,h+1); out = strcat(A,a0(i1(:)),a1(i2(:)),'c');

14 years ago | 0

| accepted

Answered
How to manipulate matrix elements ?
out = A'; out(out>0) = [B1,B2]; out = out'; or bsxfun(@times,A,1:size(A,2))

14 years ago | 0

Answered
How can I make this following matrix
q1 = cell(size(C).*[1 2 1]); q1(:,1:2:end,:) = arrayfun(@(x)zeros(2,x),C,'un',0); q1(:,2:2:end,:) = B(A); [s,s] = cel...

14 years ago | 0

Answered
How can to convert this following cell to single matrix
A = cell(size(val)); q1 = [val(:),arrayfun(@(x)zeros(2,x),max(c(:)) - c(:),'un',0)]; A(:) = num2cell(q1,2); out = cel...

14 years ago | 0

| accepted

Answered
create cell array of individual years from a long time series
try this is code (corrected) time = datevec(datenum('1966-01-01'):datenum('2009-12-03')); data = rand(size(time,1),1); ...

14 years ago | 1

| accepted

Answered
how to find the position of a given number
k = 1050 find(num2str(k)-'0' == 5)

14 years ago | 1

Answered
Edit:Error in counting uinque values
The initial data |xres| xres={{ 'YAR029W' 'd' [] 'YAR062W' 'du' 60 'YAR068W' 'du' 60 'YBL095W' 'uu' 60 'YBR0...

14 years ago | 0

| accepted

Answered
Combining unique values and counting
one way The initial data cell array |result| result={{ 'Pr1' 'P' 'Par2' 'PSO' 'Par3' 'MPSO' 'Par4' '...

14 years ago | 0

| accepted

Answered
Sorting the variables in cells
try this is code s = {'du';'dd';'uu';'ud'}; r2 = r; for jj = 1:numel(r2) q = r2{jj}(3:end,2); [i1,i1] =...

14 years ago | 0

| accepted

Answered
Displaying result more than 50%
r = result; for jj = 1:numel(r) t = cellfun(@(x)isempty(x)|ischar(x),r{jj}(:,end)); t2 = cell2mat(r{jj}(~t,e...

14 years ago | 0

| accepted

Answered
Converting to different date format
try use regexprep('2012-09-01','-0','-')

14 years ago | 1

| accepted

Answered
How to find the neighbourhood of a pixel
try this code (need have Image Processing Toolbox) I = rand(10) > .9 % initial array out = imdilate(I,ones(3)) - I; O...

14 years ago | 0

Answered
how to merge neighbourhood of a pixel
try this way (need have |Image Processing Toolbox|) I = rand(10) > .9; % initial array out = imdilate(I,ones(3));

14 years ago | 0

Answered
finding the number of occurences
r = cell(size(gene)) for jj = 1:numel(r) r{jj}(:,[1:2,4]) = gene{jj}(:,[1:2,end]); r{jj}(:,3) = [repmat({''}...

14 years ago | 0

| accepted

Answered
how to compare a single row with remaining all rows of a matrix?
out = ismember(v,v(2,:),'rows');

14 years ago | 2

| accepted

Answered
calculating percentage value and cancanating
result = gene; for jj = 1:numel(gene) emptycells = cell2mat(cellfun(@(x) ~isempty(x),result{jj},'un',0)); per...

14 years ago | 0

| accepted

Answered
Extract Values from the vector
new_vector_from_a = a(a < 1 | a > 10);

14 years ago | 2

Answered
Deleting values from a cell array
out = cellfun(@(x)x(:,1:end-1),fnl,'un',0);

14 years ago | 0

| accepted

Answered
Displaying values for more than 2 counts
result = R; for jj = 1:numel(result) [c,c,c] = unique(result{jj}(2,2:end)); [i1,i1] = max(histc(c,1:max(c))); ...

14 years ago | 0

| accepted

Load more