답변 있음
Extend a matrix by extending its vectors
B = A(kron((1:d)',ones(d,1)),:,:);

대략 12년 전 | 1

| 수락됨

답변 있음
Replacing the column of array elements with NaN.
Out_Arr = A; Out_Arr(all(bsxfun(@lt,A(:,1),x(:,1)')|bsxfun(@gt,A(:,1),x(:,2)'),2),2) = nan;

대략 12년 전 | 1

답변 있음
delete same number every two number while keeping the original order
x = [true(size(B,1),1), diff(B,1,2)~=0]'; ii = sort(x,'descend'); Bt = B'; z = nan(size(x)); z(ii) = Bt(x); out...

대략 12년 전 | 0

답변 있음
How to store the output of a loop in a matrix/vector when the loop is not indexed?
a=-1; b=-1; p=-0.5; a1 = a./sqrt(2*(1-p^2)); b1 = b./sqrt(2*(1-p^2)); x = [0.10024215,0.48281397,1.0609498,1.77...

대략 12년 전 | 0

| 수락됨

답변 있음
How to count frequency of values in a 3D array
out = histc(reshape(yourdata,[],size(yourdata,3)),1:8);

대략 12년 전 | 0

답변 있음
detect consecutive duplicates in a structure
H = squeeze(struct2cell(A)); [~,~,c] = unique(reshape([H{:}],size(H))); ttest = histc(c,unique(c));

대략 12년 전 | 0

문제를 풀었습니다


Calendar Matrix
Return a calendar matrix for the given values of month and year. Assume that Sunday is the first day of the week. The resulting ...

대략 12년 전

답변 있음
HOW TO ACCESS THE FOLLOWING ELEMENTS FROM THE GIVEN ARRAY
A1 = reshape(permute(reshape(a(1:end-1,:),2,2,[]),[1,3,2]),[],2); a02 = [a(:,2:end-1);a(2:end,end)']; A2 = reshape(p...

대략 12년 전 | 1

답변 있음
Please help: calculate average frequency of histogram
Sp=[3 9 1 2 3 2.5 7.8 6.5 9.3 9.1]'; [n,b] = histc(Sp,0:2:10); c = accumarray(b,(1:numel(Sp))',[],@(x){x}); ii = ...

대략 12년 전 | 1

| 수락됨

답변 있음
cell to double problem for loop includes cellarrays.
xc = mat2cell(A,B,size(A,2)); yc = mat2cell(C,B,size(C,2)); out = cellfun(@(a,b)(a'*a)\a'*b,xc,yc,'un',0);

대략 12년 전 | 0

답변 있음
How to generate an array alternating the values of two others?
out0 = [A(rem(0:numel(B)-1,numel(A))+1);B]; out = out0(:)';

대략 12년 전 | 0

답변 있음
How to find where the differences between elements is constant?
xy = [0 29 0 30 0 30 16760 30 16760 31 16760 31 16760 31 16760 31 16760 31 16760 32 ...

대략 12년 전 | 1

| 수락됨

답변 있음
how remove duplicate rows ?
C = setdiff(A,B,'rows','stable')

대략 12년 전 | 0

답변 있음
easy question- matrix divide
out = mat2cell(A,10*ones(30,1),size(A,2))

대략 12년 전 | 0

| 수락됨

답변 있음
Assigning a variable for matrices
S = eval(strcat('{',sprintf('S%d;',1:39),'}')); Sn = cat(3,S{:}); ii = [31 28 31 30 31 30 31 31 ...

대략 12년 전 | 0

답변 있음
a problem with for loop and indexinf
A = eval(strcat('{',sprintf('Array_%d;',1:10),'}')); AR = cellfun(@(x)exp(x)+x.^2,A,'un',0);

대략 12년 전 | 0

답변 있음
How to find string value?
out = regexp(A,'\w{2}\d{1}','match')

대략 12년 전 | 0

| 수락됨

답변 있음
Vectorization of for/loop
laminate.ply = struct('angles',num2cell(angles(:)/180*pi),... 't',num2cell(thickness(:)),... ...

대략 12년 전 | 0

| 수락됨

답변 있음
More efficient way of this code?
fun1 = @(v,n)repmat(v,1,n)

대략 12년 전 | 1

| 수락됨

답변 있음
I need help in (Position in matrix)
find(T==5)

대략 12년 전 | 0

답변 있음
determine the loop which satisfies the particular condition.
x = mat2cell(A,B,size(A,2))

12년 초과 전 | 1

답변 있음
From a large single column set of data, how can I get the differences between data points above and below each other?
datapoint - your vector out = -diff(datapoint);

12년 초과 전 | 0

답변 있음
How can I find matching rows from three out of four colomns
d = [1 2 3 4 2 4 6 8 1 2 3 5]; [a,b,c] = unique(d(:,1:end-1),'rows'); out = [a, accumarray(c,d(:,end))]; *_...

12년 초과 전 | 0

답변 있음
How to vectorize this code with logical idexing
a=[10:5:50]; b=[10:20:50]; c=rand(size(a)); [~,ii] = histc(a,b); d = accumarray(ii(:),c(:),size(b(:)),@(x){x})...

12년 초과 전 | 0

| 수락됨

답변 있음
for loop to control cellarray whether it is changing or not.
[a,~,c] = unique(ids); out = [strcat('a_',a),num2cell(accumarray(c,data))];

12년 초과 전 | 1

| 수락됨

답변 있음
how to append values in a vector in for loop?
out=[0 1;1 3;2 5;3 5; 7 2; 8 1;9 1;11 4]; k = 0; for i=1:8 if out(i,2)==max(out(:,2)) k = k + 1; ...

12년 초과 전 | 1

| 수락됨

답변 있음
How do I combine vectors to form a matrix?
combined = cell2mat(cellfun(@(x)x(:,5),mydata,'un',0));

12년 초과 전 | 0

| 수락됨

답변 있음
How to reorder the rows by sorting the elements of column in ascending order?
[~,ii] = sort(id); id_out = bsxfun(@(a,b)a(b,:),id,permute(ii,[1 3 2]));

12년 초과 전 | 0

답변 있음
Repeative selecting unique values of matrix
M = [2 3 8 1 4 7 6 5 9 1 3 8 9 4 6 5 2 7 2 8 1 4 6 3 9 5 7]; ii = ndgrid(1:size(M,1),1:size(M,2)); [...

12년 초과 전 | 0

더 보기