Answered
Operation without for loop
Y = arrayfun(@(i1)myfunction(A(i1,:), B(i1,:)), 1:size(A,1))

14 years ago | 0

| accepted

Answered
matric operation
H = [P Q]

14 years ago | 0

| accepted

Answered
edit-finding mean
out = [CLL_combinations(:,1:2,:) mean(CLL_combinations(:,3:end,:),2)]

14 years ago | 0

| accepted

Answered
unable to find the inverse of large matrix using gaussian elimination.
my old function |InvMatrix| *EDIT 2* function dout = InvMatrix(c) m = size(c,1); c = [c eye(m)]; n = m*2; for j1 = 1...

14 years ago | 0

Answered
return index of biggest element in a row-matrix.
|A| - your matrix [c,index] = max(A,[],2)

14 years ago | 0

| accepted

Answered
efficient nested foor loop
a1 = 5:-1:-5; b1 = 1:-1:-1; [a b] = ndgrid(a1,b1); F = [a(:) b(:)]; distance = sqrt(sum((F - size(F,1)).^2,2)); ...

14 years ago | 0

Answered
problem plotting random vector
hist(x,sort(vet))

14 years ago | 0

| accepted

Answered
edit-merging the values
so? for j1 = 1:size(A,1) fprintf(['combinations ',num2str(j1),' = ',mat2str(combinations(:,:,j1)),'\n']); end

14 years ago | 0

| accepted

Answered
number format
try format short g

14 years ago | 0

Answered
Second output argument as input argument
create function |myfunctionMore|: function out = myfunctionMore(x) [~,out] = myfunction(x); and below c = myfunc...

14 years ago | 0

Answered
a matrix of strings
use |cell| array b = {'ok' 'no'} a = b([1;2;1]*ones(1,3))

14 years ago | 0

| accepted

Answered
merging the values
try this is code: combinations = permute(cat(3,A,B),[3 2 1]); your 1st combination: combinations(:,:,1) your 2nd...

14 years ago | 0

| accepted

Answered
Entering a value into a returned string
May be so? a = 1; y = cell(5,1); n = 0:4 for j1 = 1:numel(n) y{j1} = taylor(f,n(j1),a); end *OR* ...

14 years ago | 0

| accepted

Answered
matrix multiplication
B = reshape(bsxfun(@times,permute(A,[1 3 2]),permute(A,[3 1 2])),size(A,1),[]).'

14 years ago | 0

Answered
calculate the (geometrical) distance between points of a matrix
eg: data =[0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 ...

14 years ago | 0

| accepted

Answered
Sort data by day of year
*EDIT 2* _[14:16(UTC+4) 26.01.2012]_ eg: a = randi([11 44],1600,1); k =datevec(datenum('01-Jan_1960')+(0:numel(a)-1)....

14 years ago | 0

Answered
array transformation
doc flipud eg: a = randi(10,2,10) out = flipud(a) OR out = a(end:-1:1,:)

14 years ago | 0

| accepted

Answered
want to find the particular column when the column content is given
i1 = find(a == 40) OR i1 = find(abs(a - 40) < 1e3*eps)

14 years ago | 0

| accepted

Answered
selecting unique rows
*EDIT* _[23:27(UTC+4) 18.01.2012]_ a = [1 2 7 8 9 0 2 2 71 2 4 1]; out0 = a(all(diff(sort(a,2),1,2) > 1e4*eps,2),:)...

14 years ago | 0

| accepted

Answered
storing data in an array
eg: i1 = 1:5; a1 = i1; OR a1 = 1:5;

14 years ago | 1

Answered
Searching for specific maxima
A = [1 2 1 2 3 2 3 4 122 120 3 4 5 3 51 4 2] [pks,locs] = findpeaks(A) [ix,ix] = sort(pks,'descend') outpks = pks(ix(...

14 years ago | 0

Answered
Differences Of The Elements Of A Matrix.
doc diff eg: H = diff(I,1,2) % differences between columns V = diff(I) % differences between rows

14 years ago | 2

| accepted

Answered
Find a vector in a structure
variant pall = cat(1,vortex(:).points); a = find(ismember(pall,[7 8 9],'rows')); b = cumsum([0 arrayfun(@(x) size(x.p...

14 years ago | 0

| accepted

Answered
equality of two matrics having NaN elements
out = A == B OR out = ismember(A,B) result: out = 1 1 1 0 1 0 in MATLAB: NaN ~= N...

14 years ago | 0

Answered
Remove row of cell array that contains 0.
out = a(all(cellfun(@(x)x~=0,a),2),:); OR out = a(all(cell2mat(a) ~= 0,2),:);

14 years ago | 0

| accepted

Answered
Differentiation Of A Function.
syms X Y real S=sqrt(8).*(3.*X.^3+3.*Y.^2.*X-2.*X); F = jacobian(S,[X,Y]); Fun = arrayfun(@(i1)matlabFunction(F(i1)),...

14 years ago | 1

| accepted

Answered
correlation pairs
I think that You not need doing this. I'm offering the following variant: LName={'Name1','Name2','Name3'}; Dat={rand(12,1),...

14 years ago | 0

| accepted

Answered
Differentiation Of A Function.
Hi Pranjal! My answer <http://www.mathworks.com/matlabcentral/answers/25738-differentiation-of-a-function here>.

14 years ago | 1

| accepted

Answered
edit-selecting random values
*EDIT* _[09:13(UTC+4) 13.01.2012]_ A = randi(48,10) s = size(A); n = [3 10]; q = reshape(1:numel(A),s(1),[]); rc =...

14 years ago | 0

| accepted

Answered
selecting random values
A = randi(48,3,10) n = 3; q = reshape(1:numel(A),n,[]); rc = size(A)- n +1; m = q(1:rc(1),1:rc(2)); p = m(randper...

14 years ago | 0

Load more