답변 있음
Problem with ismember function
Use <http://se.mathworks.com/help/matlab/ref/ismembertol.html |ismembertol|>.

대략 9년 전 | 3

| 수락됨

답변 있음
How can I apply arrayfun with 2D matrix inputs?
B = permute(A,[2,3,1]); eye3 = eye(3); for jj = 1:size(B,3) B(:,:,jj) = B(:,:,jj)\eye3; end B = permute(B,[...

대략 9년 전 | 0

| 수락됨

답변 있음
How to count the time interval at which a particular number occurs in matrix
out = a(diff([0;a(:)])~=0); or x = 999; t = a ~= x; out = a(t | [1,t(1:end-1)]);

대략 9년 전 | 0

답변 있음
How can I abbreviate this code?
% Let data -> double array [2500 x 3] n = 5; [k0,m] = size(data); k = k0/m; p = permute(reshape(data,n,[],...

대략 9년 전 | 1

답변 있음
normalization 0 and 1 in matlab imported from excel just for one row
a = [3 4 1 2 3 5 4]; norm_a = (a - min(a))/(max(a) - min(a))

대략 9년 전 | 1

| 수락됨

답변 있음
How to overwrite pars of a cell array?
k = ['full' 'zero' 'zero' 'zero' 'zero' 'zero' 'zero' 'zero' 'zero']; out = circshift(k,8);

대략 9년 전 | 0

답변 있음
Avoiding for loop with ismember
[Fixed] N = 15; c = randperm(N,4); c1 = sort(c(:)); cc = reshape(bsxfun(@plus,N*(c1 - 1),c1')',[],1); or ...

대략 9년 전 | 1

| 수락됨

답변 있음
How to extract multiple matrices of different dimensions from a large matrix?
*[Small fix]* % Let A - your matrix [110848 x 15] t = [0;time(1:8)]; t2 = seconds(milliseconds(A(:,1))); ii ...

대략 9년 전 | 1

| 수락됨

답변 있음
How do I convert an array into a set of indices using colon notation?
[m, n, k, ~] = size(Matrix1); [d,c,b,a] = ndgrid(1:3,1:k,1:n,1:m); ii = sub2ind([m,n,k,3],a(:),b(:),c(:),d(:)); out =...

대략 9년 전 | 0

답변 있음
delete elements from a cell array
regexprep(b,'[$#@]|\<https:/+\S*\>','')

대략 9년 전 | 2

| 수락됨

답변 있음
Convert array of comma separated strings in cells to matrix
Arr = { '0,2,3' '1,4,5' '2,6,7' }; T = regexprep(Arr,',',''); Brr = cell2mat(arrayfun(@(x)T{x}-'0',(1:numel(...

대략 9년 전 | 0

답변 있음
How to find row values?
for 2d arrays a = [3 2 1; -5 0 6; 0 0 7]; [~,c] = max(max(a)); b = a(:,c)

대략 9년 전 | 1

답변 있음
I have a request set of size [ 1 2 3 4 5 6 7 8 9 10] these request demand some bit rate of size [6 5 6 4 7 3 5 5 4 7] .I want to sort these request according to request that demand most bit rate.
a = [1 2 3 4 5 6 7 8 9 10]; b = [6 5 6 4 7 3 5 5 4 7 ]; out = sortrows([a(:),b(:)],-2); out = out(:,1)

대략 9년 전 | 0

답변 있음
How to insert missing dates for forenoon(F) and afternoon(A)?
T = readtable('datafile0.xls','Sheet', 2); H = hours([12;0]); [g,ii] = findgroups(T.SMD11_DATE); T.SMD11_DATE = []; ...

대략 9년 전 | 0

| 수락됨

답변 있음
Extract X number of elements in 3D matrix based on another matrix
A=randi(10,3,3,5); B=[NaN 2 1; 2 NaN 2;NaN 4 3]; [m,n,k] = size(A); B(isnan(B)) = 0; out = permute(reshape((1...

대략 9년 전 | 0

| 수락됨

답변 있음
Circshift an ND array by values in an (N-1)D array w/out for loop
A = reshape(1:24,[2 3 4]); b = [1 -1 -3 -1 -1 0]; [m,n,k]= size(A); A1 = reshape(A,[],k); ...

대략 9년 전 | 1

| 수락됨

답변 있음
Finding the angle of inclination from two end points of a line.
point1 = [22, -114]; point2 = [693, -233]; x1 = point1(1); y1 = point1(2); x2 = point2(1); y2 = point2(2); s...

대략 9년 전 | 2

| 수락됨

답변 있음
If I start with a matrix of zeros, how can I easily create a triangle of ones in that matrix?
N = 1000; T = tril(ones(N)) ; a = round(imresize([flip(T,2),T],[round(N/2*tan(pi/3)) N])); imagesc(a)

대략 9년 전 | 2

답변 있음
How to find numbers following repeating sequence in an array and number of times it occured
for ii = 2:numel(A) B = hankel(A(1:ii),A(ii:end)); [a,~,c] = unique(B,'rows'); co = accumarray(c,1); ...

대략 9년 전 | 1

답변 있음
table maximum value column
A=[0 0 0 0 0.0100000000000000 0 0.0100000000000000 1 0.0100000000000000 2 0.0200000000000000 0 0.02000000000...

대략 9년 전 | 0

| 수락됨

답변 있음
Finding maximum y value for the same x values and corresponding z values
T = table(x,y,z,'Va',{'x','y','z'}); out = varfun(@max,T,'gr','x'); or z=[... 1 9 7 8 6 5 3 ...

대략 9년 전 | 1

답변 있음
Calculate mean of columns for a unique value of column variable?
[g,ii] = findgroups(A(1,:)'); out = [ii,splitapply(@mean,A(2:3,:)',g)]'; or [ii,jj] = ndgrid(A(1,:),1:2); out =...

대략 9년 전 | 0

답변 있음
How do I manipulate data from a csv datafile containing date, time and number data?
f = fopen('Input Data.csv'); c = textscan(f,'%s %s %f','delimiter',','); fclose(f); TT = timetable(datetime(strcat(c{...

대략 9년 전 | 1

| 수락됨

답변 있음
Store Data in Cell-Array
variant for MATLAB R2016b and later out = num2cell(C2(find(strcmp(C2,'test')) + (1:5)),2) MATLAB R2016a and earlier: ...

대략 9년 전 | 0

답변 있음
How to replace value of elements from another matrix index while keeping the same original index?
STAL = [1 3; 2 7; 3 6; 4 2; 5 2; 6 1; 7 4; 8 7]; C = [0 4 1 0]; Tr = 3; New_C = C; [lo,ii] = ismember(C(:),STA...

대략 9년 전 | 0

| 수락됨

답변 있음
Compare values in cell array with a threshold value.
% input A= {[NaN,1.8,3,NaN,4];[2.6,NaN,NaN,2.9,4];[NaN,3,2,2,NaN]}; Thresh=10; B = arrayfun(@(x)num2cell(randi([0 23]...

대략 9년 전 | 0

| 수락됨

답변 있음
How to use str2num in this problem? (problem is in description)
BS = bit_str{1}-'0' Hie = fft(BS);

대략 9년 전 | 0

| 수락됨

답변 있음
Truncating vector to longest continuous string of numbers
m=[ 1 2 3 4 5 6 -5 -5 -5 1 2 3 4 5 6 7 -5 -5 -5 -5 1 2 3 4]; z = diff(m) == 1; z = [z(1);z(:)]; z(diff(z)==1) = 1...

대략 9년 전 | 1

더 보기