Respondida
select part vector put it back in other vector
S(S./movmean(S,31) >= 3) = NaN;

más de 7 años hace | 0

Respondida
how to formulate logical matrix in a loop?
A = 1:10; idx = A(:) == A(:)'

más de 7 años hace | 1

| aceptada

Respondida
Concatenate rows of cell into one column
C = cellfun(@cell2mat,num2cell(A,2),'un',0);

más de 7 años hace | 1

| aceptada

Respondida
Extracting zeros from vectors
S1 = S(S ~= 0)

más de 7 años hace | 2

Respondida
Creating array by picking certain elements from another array
s = size(A); [ii,jj,~] = ndgrid(1:s(1),1:s(2),1:s(3)); ij = [ii(:),jj(:),A(:),B(:)]; ij = ij(~isnan(ij(:,3)),:); o...

más de 7 años hace | 0

Respondida
How to convert cells within cells to double.
Let A - your cell array with cells out = cell2mat(cellfun(@cell2mat,A,'un',0));

más de 7 años hace | 0

Respondida
Why does it give an error of "Array indices must be positive integers or logical values."
k1=0.005; Cao= 31.553; K1=0.0012; K2=0.0025; k2=0.003; x = [k1 Cao K1 K2 k2]; tspan= [1 500]; y0= [14...

más de 7 años hace | 0

Respondida
Please how can I convert the some values of my cell array from 0 to NaN
A - your cell array. for ii = 1:numel(A) A{ii}(A{ii} == 0) = nan; end

más de 7 años hace | 1

Respondida
accessing all elements along the diagonals and rows (simple backprojection algorithm for image reconstruction)
A = [1 4 7 10 13; 2 5 8 11 14; 3 6 9 12 15]; s = size(A); n = ones(s(1),1); a = n*sum(A)/s(1); b...

más de 7 años hace | 0

Respondida
Generation of a matrix based on a defined order of numbers
v1 = [2 3 4 5 6 7 8 9]; v2 = [3 4 5 6 7]; n = numel(v2); q = nchoosek(v1,2)'; m = reshape(permute(... ...

más de 7 años hace | 1

Respondida
find unique sets of values in matrix, eliminate duplications
r = [3;5;6]; B = A(r,:)'; [~,~,c] = unique(B(:,2:3),'rows','stable'); ii = find(histcounts(c,1:max(c)+1) > 1); ...

más de 7 años hace | 1

| aceptada

Respondida
Sorting data from table
T - your table with variables: month, day, year and prutok. ii = findgroups(T.year); Prutok = accumarray(ii,T.prutok,[],...

más de 7 años hace | 0

| aceptada

Respondida
Transform column data to m x n matrix
OriginalData = readtable('Path_to_your_file\DataTransformation.xlsx',... 'Range','A3:C26',... 'ReadVariableNames',true);...

más de 7 años hace | 1

| aceptada

Respondida
How can i sum over seconds ?
T = testclick; T.Noisedb0061 = datetime(T.Noisedb0061,'I','uuuu-MM-dd hh:mm:ss.SSS'); TT = table2timetable(T(:,2:end),'R...

más de 7 años hace | 1

Respondida
Correspondance matrix for matching values in two vectors
a = [2 2 2 2 2 1 1 1 3 3 2 2 1 1 1 1 3 3 2 2]; b = [1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1]; [a1,~,c] = unique(a); ...

más de 7 años hace | 0

Respondida
Repeat values in a vector
b2 = b1(cumsum(ismember(a2,a1)));

más de 7 años hace | 0

| aceptada

Respondida
How do i convert randint function to randi function using Matlab
b=randi([0,1],1,n);

más de 7 años hace | 1

Respondida
Matching the maximum Values in a matrix from another vector
lo = ismembertol(STD_v,xvalues,.01,'DataScale',1); Matrix_Vector_updated = [STD_v(lo),NPV_v(lo)];

más de 7 años hace | 0

| aceptada

Respondida
Remove element from array but want to keep in indices
A(2,:)=nan;

más de 7 años hace | 0

Respondida
Check the overlap between circles
*EDIT* rad2 = rads(:) + rads(:)'; dxy = sqrt( (xy(:,1) - xy(:,1)').^2 + (xy(:,2) - xy(:,2)').^2 ); lo = dxy <= r...

más de 7 años hace | 0

| aceptada

Respondida
Creating a struct array with a for loop
a = {1,3,5,7}; b = {2,4,6,8}; c = {1,2,3,4}; out = cat(1,a,b,c) or out = [a;b;c]

más de 7 años hace | 1

Respondida
Rolling window column selection
v = randi(1000,365,1); out = v((1:24:numel(v) - 48)' + (0:47)); % version of MATLAB >= R2016a out = v(bsxfun(@plus,(...

más de 7 años hace | 0

Respondida
How to write a function that will count the number of prime numbers betweeen n1 and n2 using a for loop?
Without loops CountPrimes = @(n1,n2)sum(isprime(n1:n2)); use >> CountPrimes = @(n1,n2)sum(isprime(n1:n2)); >...

más de 7 años hace | 0

Respondida
how to reverse a random permutation of a matrix to get back the original matrix?
key1 = randi(398,4,5); s = size(key1); p = reshape(randperm(numel(key1)),s); O = key1(p); [~,ii] = sort(p(:));...

más de 7 años hace | 0

| aceptada

Respondida
how to use "ln" function on each elemnets of the matrix?
Here |yourmatrix| - double array. log(yourmatrix)

más de 7 años hace | 0

| aceptada

Respondida
Frequency of unique rows
a = [0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 2 0 0 0 2]; [aa,~,c] = unique(a,'rows'); out = ...

más de 7 años hace | 1

| aceptada

Respondida
How to find a specific row in the matrix
M = [1 8 11 2.1; 2 10 12 1.8; 1.5 9 10 2.2; 1 9 10 1.9]; [~,ii] = min(M(:,end)); out = M(ii,1:3);

más de 7 años hace | 1

Respondida
Changing block row matrix to block column matrix?
[EDIT] B = 2; % the number of blocks [m,n] = size(c); out = reshape(permute(reshape(c,m,n/B,[]),[1,3,2]),m*B,[]);

más de 7 años hace | 2

| aceptada

Respondida
How to concatenate the rows of char array containing 8-binary string ?
a = string('10111011'); b = string('10101010'); a + b

más de 7 años hace | 0

Respondida
How do merge two vectors into one, like in intersect. but now with a small margin
out = A(ismembertol(A,B,1,'DataScale',1));

más de 7 años hace | 0

Cargar más