답변 있음
How to find a vector in a matrix?
s = size(B) - 1; n = size(A) - s; out = []; for ii = 1:n(1) i1 = ii : ii + s(1); for jj = 1:n(2) ...

13년 초과 전 | 1

답변 있음
replace missing value in a matrix using intropolated values
one way t = ~isnan(A); [x,y] = find(t); F = TriScatteredInterp(x,y,A(t)); [ii,jj] = ndgrid(1:size(A,1),1:size(A,2)...

13년 초과 전 | 0

답변 있음
how can i get output
if x = [43 3 0 10]; % double array y = x*10.^(6:-2:0);

13년 초과 전 | 0

답변 있음
how can i get output
y = str2num(sprintf('%d',x));

13년 초과 전 | 0

답변 있음
how can i get output
s = '391632'; out = str2double(mat2cell(s,1,[2 4])); or a = s - '0'; out = [polyval(a(1:2),10), polyval(a(3:...

13년 초과 전 | 0

답변 있음
How to add arrays to specific rows of a matrix in single step ?
a = randi(9, 10, 4); b = 100*ones(1, 4); rs = [2 5 7 9]; a(rs,:) = bsxfun(@plus,a(rs,:),b);

13년 초과 전 | 0

| 수락됨

답변 있음
maximal subset N of binary matrix
M = rand(200) > .95; % your binary matrix out = M(sum(M,2) > 10,:);

13년 초과 전 | 0

문제를 풀었습니다


matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

13년 초과 전

문제를 풀었습니다


Reference Index Number
Given a reference set R of elements (each unique but identical in type), and a list V of elements drawn from the set R, possibly...

13년 초과 전

답변 있음
this code is not working for transition probability matrix ....make it correct?
p1h = zeros(9); for ii = 1:9 p1 = Yh(1:end-2,:) == ii; for jj = 1:9 p2 = Yh(2:end-1,:) == jj; ...

13년 초과 전 | 0

답변 있음
how to compare each element of matrix?
t = 4; f = [1 2 3 4; 2 3 4 5 ; 5 6 7 8 ; 1 2 3 5]; out = abs(f - t) < eps(100) ADD out = f; out(f <= t) ...

13년 초과 전 | 0

| 수락됨

답변 있음
how to view the matrix in 2 dimension of the following values
d = randi(1000,5,486,586); % your array out = reshape(d,size(d,1),[]); %the horizontal orientation or d1 = num2...

13년 초과 전 | 0

답변 있음
how to give a matrix index value from negative?
a = -4:4; a(1) for prasanna comment su=4; sv=4; fh=[1 2 3 4; 2 3 4 5 ; 5 6 7 8 ; 1 2 3 5]; t = -4:4; n ...

13년 초과 전 | 0

| 수락됨

답변 있음
use "for loop" for n times but n is not fixed
v = 1:5; n = 3; a = cell(1,n); [a{:}] = ndgrid(v); out = cell2mat(cellfun(@(x)x(:),a,'un',0));

13년 초과 전 | 1

답변 있음
Sorting and Saving a subset from the array
a0 = {16 1232 56 16 3455 56 16 5443 76 16 1232 88 17 4545 65 17 3432 87}; a = cell2mat(a0); [b,~,c] =...

13년 초과 전 | 0

답변 있음
[MATLAB] I need any help for this problem
M = {Mat1,Mat2,Mat3}; M1 = cat(1,M{:}); n = cellfun(@(x)size(x,1),M(:)); n1 = [0;cumsum(n)]; n2 = zeros(n1(end),1)...

13년 초과 전 | 0

답변 있음
How to make combinations of given condition?
k = dec2bin(0:sum(pow2(0:4)))-'0'; out = 2*k(sum(k,2) == 2,:);

13년 초과 전 | 1

| 수락됨

답변 있음
Short question: Using the find command
[~,g1] = unique(X(:,3),'first'); G = sort(g1);

13년 초과 전 | 0

문제를 풀었습니다


Simple return on investment
Assume you have some money and want to invest all your money to stock market. You randomly select a stock and invest all your mo...

13년 초과 전

문제를 풀었습니다


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

13년 초과 전

문제를 풀었습니다


Get ranks of values in a vector
For a given vector, say [6 3 8 2], return the ranks (ascending) of observations, i.e. [3 2 4 1]. Do not worry about tied ranks. ...

13년 초과 전

문제를 풀었습니다


Volume difference between Ellipsoid and Sphere
Given an ellipsoid of semi principal axis (a,b,c) find the volume of the difference between this ellipsoid and the sphere with...

13년 초과 전

답변 있음
defining a vector with vector of indices
A(B) = C; here C - with |size(C) = [1,1]| or |numel(C) == numel(B)|

13년 초과 전 | 1

답변 있음
Can anyone please help me to understand the problem here? I keep getting the error "Index exceeds matrix dimensions".
if size(circles,1) == size(peaks,1) dc = cellfun(@(f)f(ang).*peaks(3,circles(:,1) & peaks(:,2)),{@cos,@sin},'un',0); ...

13년 초과 전 | 0

답변 있음
a=rand(400), this function generates 400*400 random matrix a,how could generate matrix a with specified mean and variance.
|m| - your mean |s| - your variance |size_matrix| - size of your array < a x b > , |size_matrix = [a,b]|; fun1 = @(m,...

13년 초과 전 | 1

답변 있음
solving simple equations in matlab
dat = d1.'*(.1./d2);

13년 초과 전 | 1

| 수락됨

답변 있음
Is there faster way of computing loop; max(w .* x); pool; ?
r = max(bsxfun(@times,reshape(w',size(w,1),[]),reshape(x,1,size(x,2),[])),[],3); or r = max(bsxfun(@times,permute(w,[2...

13년 초과 전 | 0

답변 있음
how to delete repated rows with out re order them
out = unique(levelx,'rows','stable');

13년 초과 전 | 1

답변 있음
All the posible combination of two matrices
C = []; for j1 = 1:numel(B) a = nchoosek(B,j1); C = [C;num2cell([repmat(A,size(a,1),1),a],2)]; end

13년 초과 전 | 0

| 수락됨

더 보기