Community Profile

photo

Andrei Bobrov


4 787 total contributions since 2011

null

Andrei Bobrov's Badges

  • Thankful Level 3
  • Master
  • 36 Month Streak
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer
  • Scavenger Finisher
  • CUP Challenge Master
  • Commenter
  • Leader
  • Speed Demon
  • Solver

View details...

Contributions in
View by

Answered
Selecting cross values from two arrays
s = [0,1000,2000]; d = [0,1000,2000]; J = [0,5000,8000]; ii = fullfact([3,3,3]); out = [s(ii(:,1))',d(ii(:,2))',J(ii(:,...

2 dagar ago | 0

Answered
Sample data from time-dependent array
data = [ 228.0000 23.7800 236.0000 23.8767 244.0000 23.9400 256.0000 24.1400 268.0000 23.8200 276.0000 2...

2 dagar ago | 0

| accepted

Answered
How to extract first non-zero element in each column and put into a new array
out = in(cumsum(cumsum(in~=0)) == 1)'

2 dagar ago | 1

Answered
Finding consecutive data with non zero in array
x = ~xx(:); nn = numel(x); n = diff([find(diff([1;x(:)])~=0);nn+1]); y = mod(2 - x(1) +(0:numel(n)-1)',2); lo = repelem(~all...

3 dagar ago | 0

Answered
Finding index location in volume?
x = 2000:0.5:2004; y = 45000:0.3:45009; z = 10:0.2:12; x0 = 2002.13; y0 = 45006.811; z0 = 11.36; C = nan(9,31,11); ...

3 dagar ago | 1

| accepted

Answered
How to loop this operation ?
ii = 300:-20:20; D = TarG(ii)./[100;TarG(ii(2:end) + 1)]; Tot_TarG = cumprod(D);

7 dagar ago | 1

| accepted

Answered
Converting two matrix to a single table
T = table(reshape(M1',[],1),reshape(M2',[],1)); T.properties.VariableNames = {'M1_value','M2_value'};

7 dagar ago | 0

Answered
I have time series data of 1 year each day 2880 values row wise so a matrix of 365X2880. I want to do monthly average. January 31 days average one file of one month, so that I can finally get 12 files each of monthly average.
A - you're array 365 x 2880, in example per 2015 year. t = (datetime(2015,1,1):datetime(2015,12,31))'; TT = array2timetable(A,...

7 dagar ago | 1

| accepted

Answered
getting the max and its positions from a 4D array
Maybe this: [m,n,k,f] = size(totalDistance);% here k = 1 [~,ij] = max(totalDistance,[],4); [I,J,K] = ndgrid(1:m,1:n,1:3); F ...

7 dagar ago | 0

Answered
sum of timetables for each months
Buses = [5;8]; cars = [10;18]; Time = datetime(2019,[8;9],1); buses = timetable(Time,Buses); cars = timetable(Time,cars); ...

8 dagar ago | 1

| accepted

Answered
sub2ind Get values of 3D matrix using an index array?
[m,n,k] = size(M); [q,w] = ndgrid(1:m,1:n); out = M(sub2ind([m,n,k],q,w,A));

9 dagar ago | 2

| accepted

Answered
List(Vecor) Generation
m=3; n=4; T = 1:m*n; out = ceil(T/m) + mod(T-1,m); or out = floor(T/n) + mod(T-1,m) + 1; or out = repmat(1:m,1,n) + rep...

11 dagar ago | 0

Answered
HOW Calculate the distance of points form one center in 2-D space and display output in a distance matrix?
X = rand(5,1) Y = rand(5,1) D = squareform(pdist([X,Y])) or XY = [X, Y]; D = sqrt(squeeze(sum((XY - permute(XY,[3,2,1])).^2...

11 dagar ago | 1

Answered
How can I convert this table to a cell array as shown in the screenshot?
tout = varfun(@(x){x(:)'},T,'GroupingVariables','id'); C = tout{:,3:end}; measure = C(:,1); t = C(:,2);

13 dagar ago | 2

| accepted

Answered
for loop values of certain output range
x = 3; c = -2:1:2; q = -2:1:2; g = c*x + q.*(c+x); lo = g >= 5 & g <= 10; out = table(c(lo),q(lo),g(lo),'Variablenames',{'c...

14 dagar ago | 0

Answered
Reading content of a file using readtable return NaT for Time
T = readtable('eventlog.txt','format',... '%d %{yyyy-MM-dd HH:mm:SS}D %s %s %s','delimiter','|',... ...

14 dagar ago | 0

Answered
how to count daily events from a time series data
out = varfun(@(x)x,T,'GroupingVariables',{'Year','month','day'},... 'Inpu...

14 dagar ago | 0

Answered
Creating a matrix having repeating elements
A = kron(eye(5),[1;1])+kron(diag(-ones(4,1),1),[1;1]); out = A(1:5,:); or n = 1:5; A = repmat([1,-1,0,0,0],5,1); out = A(mo...

14 dagar ago | 1

| accepted

Answered
How to cite the row of the matrix by vectorization?
For large matrices, the cycle may be faster. a = repmat(1:6,3,1)'; index = [1:3;2:4]; si = size(index); result = permute...

15 dagar ago | 0

| accepted

Answered
inserting rows in a matrix
kron(yourmatrix(:),[1;zeros(24,1)]);

15 dagar ago | 1

Answered
General Binomial Matrix Manipulation
Aend = reshape(Abegin.*permute(Abegin,[1,3,2]),size(Abegin,1),[]);

15 dagar ago | 1

Answered
A cycle for creating and working with zones
n = numel(Data); ii = ceil((1:n)'/100); TF = accumarray(ii,Data(:),[],@(x){isoutlier(x)});

16 dagar ago | 0

| accepted

Answered
array manipulation in loop through a sequence
E = ones(4); n = size(E,1); for ii = 1:n E(ii,n-ii+1:n) = E(ii - 1 + (ii == 1),n-ii+1:n) + 1 end

16 dagar ago | 1

| accepted

Answered
Matrix problem for same values of column
[m,n] = size(A); B = [(1:m)',A(:,2:3)]; k = B(1,2:3); ii = 1; C{1} = []; while ~isempty(B) i0 = ismember(B(:,2:3),k); ...

16 dagar ago | 0

Answered
function to fill in zeros
data=[100 95 0 90 0 85 0 0 70 65 ]'; data(data == 0) = nan; new_data = fillmissing(data,'linear'); or ii = (1:numel(data))...

16 dagar ago | 2

| accepted

Answered
Averaging the previous 5 values of every 30 values in a matrix
m = size(numData,1); lo = mod((0:m-1)',30) + 1 >= 26; ii = ceil((1:m)'/10); HRmean5 = accumarray(ii(lo),numData(lo,3),[],@mea...

17 dagar ago | 0

Answered
Generate a N length vector from a M length list (permutation)
out = fullfact(3*ones(1,5));

17 dagar ago | 0

Answered
Find rows in matrix based on columns value
My case for mat: mat = [1 11 3 10 5 6 10 10 9 10 11 12]; mat2 = sort(mat,2); [m,n...

17 dagar ago | 2

Answered
Sum if multiple conditions satisfied across vectors
MKT = [1 ; 1 ; 1 ; 2 ; 2 ; 2]; GROUP = [1 ; 1 ; 2 ; 1 ; 2 ; 2]; SHARE = [0.2 ; 0.3 ; 0.5 ; 0.6 ; 0.1 ; 0.3]; T = table(MK...

17 dagar ago | 0

| accepted

Answered
Replace row of matrix with vector by logical indexing
a = 101:120; lo = a(:) > 112; b(lo,:) = lo(lo>0).*[55,56,57,58,59];

17 dagar ago | 0

Load more