Community Profile

photo

Andrei Bobrov


4,691 total contributions since 2011

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
How to create a matrix out of all the possible combinations of a vector
Please see answer by Roger Stafford. In your case: a = 3:5; v = [0,-1,1]; n = cumsum(a,'reverse'); C1 = nchoosek(1:n(1),a...

6 hours ago | 1

| accepted

Answered
calculate area in table
T = readtable('Book1.xlsx'); out = varfun(@sum,T,'g','Class_Name');

1 day ago | 0

| accepted

Answered
Generating random variable from certain standard deviation and mean
a = .3;% standard deviation b = 0; % mean out = a.*randn + b;

4 days ago | 1

| accepted

Answered
Sub-Matrices in a bigger matrix
For matrices with the same size. Let [m,n] - size of each matrix, q - number of matrices in the vertical of a large matrix: M...

4 days ago | 0

Answered
For Loop Problem error
img=imread('C:\Users\Shalaw\Downloads\gray.jpeg'); [n,m]=size(img); imgs = mat2cell(img,[n,n]/2,[m,m]/2)'; for ii = 1:4 ...

8 days ago | 0

Answered
Calculate based on row
out = cellfun(@(x)-diff(x),your_cell_array,'un',0);

8 days ago | 1

| accepted

Answered
Creating dates tables with loop
dates = (datetime(2014,4,16,0,0,0):hours(1):datetime(2016,6,8,0,0,0))';

8 days ago | 1

| accepted

Answered
Problem in matrix dimension
T = readtable('fire_archive_M6_59116.csv'); a = T.acq_time/100; T.acq_date = T.acq_date + hours(fix(a)) + minutes(100*mod(a,1)...

12 days ago | 0

| accepted

Answered
how to get combination of elements in a matrix in pair order
A=[3 5 6 7 8]; [y,x] = ndgrid(A); B = [x(:),y(:)]; B = B(diff(B,1,2) ~= 0,:);

12 days ago | 0

Answered
how to loop in one time to get the max value minus the min value.
[a,~,c] = unique(cdata{1}(:,1:4),'rows','stable'); out = [a,accumarray(c,cdata{2},[],@(x)max(x) - min(x))];

12 days ago | 0

Answered
Checking for multiple values that are the same in a vector
C = C(:); d = [1;diff(C) ~= 0]; ii = cumsum(d); counts = accumarray(ii,1); k = find(counts >= 10); lo = ismember(ii,k); ...

13 days ago | 1

| accepted

Answered
Error when multiplying two vectors
Use .* and ./: Want=IWant.*lett+20./lett+1;

13 days ago | 0

| accepted

Answered
To equate one value to another?
May be like this: Let S - your signal. m = min(S); detph = 10/(max(S) - m)*(S - m) + 5;

13 days ago | 0

| accepted

Answered
Find and edit interval of array when element is equal to a value?
i1 = double(diff([A,0]) == -2); ii = find(i1) - 3; i1(ii(ii > 0)) = -1; out = cumsum(i1,'revers').*A

14 days ago | 1

Answered
how to store each ans which we get from loop in a 2-d array ?
Thin_image = single(rand(7) > .8); % for example out = conv2(Thin_image,ones(3),'valid'); ridge = sum(out(:) == 1); bifurca...

14 days ago | 0

Answered
Howe can I subtract neighboring numbers?
diff(z) z/60

16 days ago | 0

| accepted

Answered
Comparing two matrix elements summing third and storing them separately
[B,BB] = groupsummary(A(:,3),A(:,1:2),'sum'); out = [BB{:},B];

16 days ago | 0

Answered
How to generate a hankel and toeplitz array of blocks from three series?
A = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ]; [m,n] = size(A); C = num2cell(A,1); ii = triu(toeplitz(1:n-1)); H ...

16 days ago | 0

| accepted

Answered
how can remove the rows and columns which has ones in all
A=[1 1 1 1; 1 0 1 1;1 0 0 1]; AA = ~A; B = A(any(AA,2),any(AA));

16 days ago | 0

Answered
How to reshapre a matrix?
A =[... 0.5377 0.7254 0.4889 0.3252 1.8339 -0.0631 1.0347 -0.7549 -2.25...

21 days ago | 1

| accepted

Answered
convert excel date and time to matlab
data = [ 9264 20180104 0.8021 9265 2018...

25 days ago | 0

| accepted

Answered
omit nonzero elemnt in cell
A(cellfun(@(x)numel(x) == 1 && x == 0,A)) = {[]};

25 days ago | 0

| accepted

Answered
Interpolation of matrices corresponding to time vector
Variant with interp1: t = [1, 2, 3]; A = {[1, 1; 1, 1] ,[1, 0.9;0.95, .87] , [1.1, 0.85;0.91, .8]}; tt = [1.2, 2.1, 2.9]; ...

27 days ago | 1

| accepted

Answered
how to fill pre allocated matrix using two columns vectors
xx = 10:10:50; yy = 40:10:80; X = [ 35;43;22]; Y = [75;44;67]; m = numel(xx); n = numel(yy); out = zeros(m,n); x10 = ...

27 days ago | 1

| accepted

Answered
How to find nearby labels?
I =[... 1 1 1 2 3 3 1 1 2 2 3 3 4 4 4 5 5 3 ...

28 days ago | 0

| accepted

Answered
How to extract column and row index and the corresponding value from a matrix?
A = [0 1 4 7 6 0]; out = sortrows([fullfact(size(A)),A(:)]);

30 days ago | 1

Answered
can we check a condition at the end of a loop?
B = sort(repmat(1:8,6,4),2); [m,n] = size(B); for i0 = 1:m while any(~diff(B(i0,:))) B(i0,:) = B(i0,randperm(n))...

1 month ago | 0

Answered
Calculating Means for Blocks of Data from Excel
A = [2 1 2 3 5 8 6 9 4 3 2 3 2 1 4 6 7 8 9 6 3 2]; lo = A(:) >= 4; loo = cumsum([0;diff(lo)==1]).*lo; lo3 = loo > 0; out =...

1 month ago | 0

Answered
How to change 0 to 1 and update a matrix
n = numel(x1); y1 = ~x1; % if MATLAB >= R2016b k = y1.*eye(n); % if MATLAB <= R2016a k = bsxfun(@times,y1,eye(n)); out...

1 month ago | 0

| accepted

Answered
Sort a list of files
data = { 'dantec7100_Ma=01_wait_1000_ Yaw -10,00° Pitch -10,00°' 'dantec7100_Ma=01_wait_1000_ Yaw -10,00° Pitch -15,00°'...

1 month ago | 0

| accepted

Load more