Beantwortet
How to resize the element matrix inside a cell array?
Here Z - your cell array z4 = cat(4,Z{:}) out = reshape(cat(4,Z{:}),[],size(z4,4)); or out = reshape(permute(ca...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
how to combain matrix with vector
a = [9 8 7; 6 5 4]; v = [1 2 3 4 5]; z = {a;v}; [ii,jj] = cellfun(@size,z); n = max(jj); out = cell2mat(arr...

mehr als 8 Jahre vor | 1

Beantwortet
Extracting column and specific sorted row data from a large text file
*[EDIT]* f = fopen('FILE_MATLAB.txt'); c = textscan(f,'%s','delimiter','\n'); fclose(f); c = c{:}; cw = c(f...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
Can someone help with a nested for loop question...
m = 3; M = zeros(m); jj = (0:m-1)'*m; for ii = 1:m M(:,ii) = jj + ii-1; end

mehr als 8 Jahre vor | 0

Beantwortet
How to average seconds data to minutes data?
T = readtable('V.csv'); T.Var1 = datetime(T.Var1,'f','HH:mm:SS'); TT = table2timetable(T); TT_out = retime(TT,'minute...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
Matrix index is out of range for deletion
*[EDIT]* MATLAB >= R2016b B = permute(A,[3,2,1]); out = A(all(any([A(:,1) == B(:,1,:),A(:,2:4) < B(:,2:4,:),A(:,5:end...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
How to make an array of alternating 1 and -1?
out = 2*rem(1:12,2) - 1

mehr als 8 Jahre vor | 2

Beantwortet
Select a random number from each row of a matrix?
>> [m,n] = size(A); >> out = A(m*(randi(n,m,1)-1)+(1:m)')

mehr als 8 Jahre vor | 0

Beantwortet
Creating a diagonal matrix with specific diagonal vectors
out = gallery('tridiag',C,A,B); % here out - sparse matrix

mehr als 8 Jahre vor | 1

Beantwortet
How can I count the number of item within each hour?
a = {'01-02-2014 05:47:30' '01-02-2014 06:00:04' '01-02-2014 06:02:48' '01-02-2014 06:03:17'}; t = datetime(a,...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
Find average of only directly repeating values in array
ii = [true;diff(A(:,2)) ~= 0]; out = [accumarray(cumsum(ii),A(:,1),[],@mean),A(ii,2)];

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
How to make a 3d array and fill each 2d array of it by numerical numbers without for loop?
One variant: n = 4; out = repmat(reshape(1:n,1,1,[]),5,5,1); other variant [~,~,out] = ndgrid(1:5,1:5,1:n); ...

mehr als 8 Jahre vor | 0

Beantwortet
How to use for loop for below
Here tAB - your array (first column - time in seconds) ii = tAB(tAB(:,2) == 0,1); lo = false(size(tAB,1),1); for jj =...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
How to Find a Value From Another Value?
A = reshape(1:16,4,[]); % Let A - your array (example) out = A(A(:,end) == 14,1)

mehr als 8 Jahre vor | 0

Beantwortet
error in code please help
Please see <https://se.mathworks.com/matlabcentral/answers/uploaded_files/97716/fig20171207.png here>.

mehr als 8 Jahre vor | 0

Beantwortet
add matrix with respect to dimension
M = randi(25,3,3,4) addarray = rand(3) out = cat(3,M,addarray)

mehr als 8 Jahre vor | 0

Beantwortet
How to multiply N matrices without a FOR loop? (Slices of 3D array)
s = size(M) out = M(:,:,1); for ii = 2:s(3) out = out*M(:,:,ii); end

mehr als 8 Jahre vor | 1

Beantwortet
Index character in table
out = cellfun(@(x)x(1:3),A,'un',0);

mehr als 8 Jahre vor | 0

Beantwortet
Find rows in a matrix that are not duplicates
Let |a| - your array. [~,~,c] = unique(a(:,1:3),'rows'); out = a(accumarray(c,1) == 1,:);

mehr als 8 Jahre vor | 0

Beantwortet
Split a periodic matrix
[v0,i0] = findpeaks(-x(:)); [v,ii] = findpeaks(x(:)); a = zeros(numel(x),1); a([i0,ii]) = 1; [v1,i1] = ismembertol...

mehr als 8 Jahre vor | 0

Gelöst


Octoberfest festival
A group of students decided to visit Octoberfest festival. First they ordered one beer, then after half-hour they taken one more...

mehr als 8 Jahre vor

Beantwortet
How to generate 4x4 lower triangular matrix?
a = tril(T(:) - T(:)'); A1 = cumprod([ones(numel(T),1),a(:,1:end-1)],2);

mehr als 8 Jahre vor | 0

Beantwortet
How to remove duplicate groups of rows
Let A - your data as array with size (2e4 x 30) [ Year Month Day Longitude Latitude ... and etc.] [~,ii] = uniquetol(A(:,4:...

mehr als 8 Jahre vor | 0

Beantwortet
Show All Possible Combination and Max. Value
M = {A;B;C;D;E;F}; CL = cat(3,M{:}); [m,n,k] = size(CL); out = cell(k-1,1); for ii = 2:k a = nchoos...

mehr als 8 Jahre vor | 0

Beantwortet
transform a 3x1 cell array containing {2x4}cell arrays into 2x1 cell array containing {3x4}cell arrays
out = mat2cell(cat(1,C{:}),[3 3],4)

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
can anyone tell me how to execute the following code under some specified conditions
Ncarrier = 20:20:80; %number of subcarriers in OFDMA Nuser = 10; ratio = .1; n = numel(Ncarrier); out = cel...

mehr als 8 Jahre vor | 0

Beantwortet
distance between array entries
a = [4 9 7 3 10 19 2 11]; [~,iout] = min(abs(a(:)-a(:)')+diag(nan(numel(a),1)),[],2);

mehr als 8 Jahre vor | 0

Beantwortet
how can i create a loop for this pattern
I'm corrected my code. Maybe so? ts = 252; years = 10; d = ts*years; epsilon = randn(1,d); % !!!!!!!!! here...

mehr als 8 Jahre vor | 0

Beantwortet
Matrix manipulation from one to another one
A = B; s = size(A); [~,ii] = sort(rand(s)); n = s(1)*(0:s(2)-1); ii = bsxfun(@plus,ii,s(1)*(0:s(2)-1)); jj = ze...

mehr als 8 Jahre vor | 0

Beantwortet
How do I get the index of the element that's the start of an embedded vector within a longer vector? Order mainintained.
v = [1 2 4 7 6 9 5 3 4 6 7 12 10]; [~,ii] = ismember([4,6,7],hankel(v(1:end-2),v(end-2:end)),'rows');

mehr als 8 Jahre vor | 0

Mehr laden