답변 있음
how to reverse a matrix from bottom to top row wise and then pick out odd rows?
A =[10000 00010 10101 10011 10000 00001]; A = num2str(A); b =...

13년 초과 전 | 0

| 수락됨

답변 있음
calculate mean of a vector
out = mean(vect);

13년 초과 전 | 0

| 수락됨

답변 있음
Write a date loop in matlab
d = [19261103; 20121231]; ddte = datenum(num2str(d),'yyyymmdd'); ndte = (ddte(1):ddte(2))'; t = weekday(ndte); n...

13년 초과 전 | 2

답변 있음
combination of numbers which is not in matrix form
A=[1 6]; B=[2 3 4]; C=[8 9]; Use function |fullfact| from |Statistics Toolbox|. for your case: t = {A,B,C}; k = ...

13년 초과 전 | 0

답변 있음
Calculate Sn (like median absolute deviation) using matlab.
s = [3 1130; 4 1527; 3 907; 2 878; 4 995]; k = permute(abs( bsxfun(@minus,s,permute(...

13년 초과 전 | 0

| 수락됨

답변 있음
i need to code for neighboring pixel
i1 = imdilate(A,ones(3)); l1 = find(A==0); i2 = i1(l1); A(l1(i2 == 255)) = 127;

13년 초과 전 | 0

답변 있음
Create a new matrix from a mapping process
Vin = {'A' 'B' 'B' 'C' 'A'}; return1 = [Vin{:}] - 'A' + 1; or KS = {'A','B','C'}; VS = [1:3]; Vin = {'A'...

13년 초과 전 | 0

| 수락됨

답변 있음
Identify an array of arbitrary minimum values. Alternatives to min / find ?
eg: tolerance = 1e-3; ii = abs(Vector - arbitrary_value) < tolerance; Value = Vector(ii); index = find(ii); ...

13년 초과 전 | 1

| 수락됨

답변 있음
matrix value in broyden's method
jac(x) = jac(x) + (y - jac(x)*s)*s.'/(s(:).'*s(:)); or jac(x) = jac(x) + (y - jac(x)*s)*s.'/norm(s).^2;

13년 초과 전 | 0

답변 있음
merging two matrices (cell matrices)
C = zeros(size(A).*[1 2]); C(:,1:2:end) = A; C(:,2:2:end) = B;

13년 초과 전 | 0

답변 있음
Check max value of an array against a constraint
max(a(a<1)); and index of the location a1 = a; a1(a1<1) = -inf; [value,i1] = max(a1(:)); [ii,jj] = ind2sub(si...

13년 초과 전 | 0

| 수락됨

답변 있음
How can I generate a Matrix (4x4) with random different figures from 1 to 4 ?
n = 4; A = rem(bsxfun(@plus,1:n,(0:n-1)')-1,n)+1; or [EDIT] A = hankel(1:n,[n 1:n-1]); A = A(randperm(n),:); ...

13년 초과 전 | 0

답변 있음
Help with a function in a loop
function [s1, f] = ngramsfreq(str,n) n1 = numel(str) - n + 1; s1 = str(hankel(1:n1,n1:n1+n-1)); [s1,~,c] ...

13년 초과 전 | 0

| 수락됨

답변 있음
How to make the same length of number?
ii = [true,diff(gb)~=0]; g = [gb(ii);diff(find([ii,true]))]; g1 = g(:,g(2,:)>1); [a,b,c] = unique(g1(1,:)); w = ac...

13년 초과 전 | 2

답변 있음
assigning to vectors within bsxfun
Z1 = bsxfun(@plus,Z(1:op:op*max(Y)),M(:).'); s = size(Z1); Z2 = zeros(s); Z2(sub2ind(s,Y,1:s(2))) = 1; x = Z1.*fli...

13년 초과 전 | 1

답변 있음
how to creating new matrix which is the variables come from 2 different matrix..?
C = permute(cat(3,A,B),[2 3 1]) in cell array Ccell = reshape(num2cell(C,[1 2]),[],1); with |for|-loop C2 = ce...

13년 초과 전 | 0

| 수락됨

답변 있음
Matrix operation without for-loop
q = reshape(1:6,[],2); % let your vectors as [q1,q2] s = size(q,1); Q = bsxfun(@times,reshape(q,s,1,[]),reshape(q,1,...

13년 초과 전 | 0

| 수락됨

답변 있음
Return to the start of a loop
str = 'abcad' ; n=3; out = str( hankel(1:n,n:numel(str)) ); without |hankel| out = str( bsxfun(@plus,1:n,(0:n...

13년 초과 전 | 0

| 수락됨

답변 있음
Find for each value of a vector
v = max(bsxfun(@times,bsxfun(@ge,X(:),Y(:)'),1:numel(Y))),[],2);

13년 초과 전 | 0

답변 있음
How to accumulate values into a variable using for loops?
Y = cumsum(conv(X,[1 1]/constant,'valid'));

13년 초과 전 | 0

답변 있음
How do I create this vector: [10,8,10,8,10, ...]?
repmat([10 8],1,100)

13년 초과 전 | 1

답변 있음
counting without built in function?
out = histc(a,[b(:,1)',b(end)])

13년 초과 전 | 0

답변 있음
check a null value
att={'strong',[],'wind',[],'overcast','weak',[]}; t = cellfun('isempty',att); example a1 = att; a1(t) = {0}...

13년 초과 전 | 0

답변 있음
how to write a matlab prog. for the exp. z(t)=y^3 where y=x when 0<=t<=1 ; y=3*x when 1<t<=2.
k = [0 1 3 0]; [j1,j1] = histc(t,[-inf,0,(1:2)-eps(100),inf]); z = (k(j1)*x).^3;

13년 초과 전 | 0

답변 있음
Problem when using solve, do I need a different function
ff=matlabFunction(eq1); out = fzero(ff,6);

13년 초과 전 | 1

문제를 풀었습니다


sinus function
x is the abscissa. find the absolute value of cosine of -x and the same value with changed sign.

13년 초과 전

문제를 풀었습니다


Find the function 2
Given a set of point (x,y) and the coordinate x of a new point, find the y value of new point. Test Suite is based on only one ...

13년 초과 전

문제를 풀었습니다


only input
Return the output without writing any code into the function.

13년 초과 전

문제를 풀었습니다


subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

13년 초과 전

문제를 풀었습니다


frame of the matrix
Given the matrix M, return M without the external frame.

13년 초과 전

더 보기