Community Profile

# Andrei Bobrov

4.687 total contributions since 2011

#### Andrei Bobrov's Badges

View details...

Contributions in
View by

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 ...

circa 20 ore ago | 0

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

circa 20 ore ago | 1

| accepted

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

circa 22 ore ago | 1

| accepted

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)...

5 giorni ago | 0

| accepted

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,:);

5 giorni ago | 0

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))];

5 giorni ago | 0

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); ...

6 giorni ago | 1

| accepted

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

6 giorni ago | 0

| accepted

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;

6 giorni ago | 0

| accepted

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

6 giorni ago | 1

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...

7 giorni ago | 0

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

9 giorni ago | 0

| accepted

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

9 giorni ago | 0

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 ...

9 giorni ago | 0

| accepted

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));

9 giorni ago | 0

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

14 giorni ago | 1

| accepted

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

18 giorni ago | 0

| accepted

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

18 giorni ago | 0

| accepted

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]; ...

20 giorni ago | 1

| accepted

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 = ...

20 giorni ago | 1

| accepted

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

20 giorni ago | 0

| accepted

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(:)]);

22 giorni ago | 1

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))...

24 giorni ago | 0

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 =...

24 giorni ago | 0

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...

24 giorni ago | 0

| accepted

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°'...

25 giorni ago | 0

| accepted

Could anyone help me how to shuffle the numbers in each column
[m,n] = size(A); out = zeros(m,n); out([randperm(m) + (0:m-1)*m,randi(m,1,n-m)+m^2]) = A(A~=0);

28 giorni ago | 0

| accepted

Vector operations not working correctly
cvPredictions = pval < epsilon;

30 giorni ago | 0

| accepted