Community Profile

photo

Andrei Bobrov


4.823 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 find nearest date and its corresponding value !
load('date.mat'); load('AOD.mat'); d = datetime(A,'ConvertFrom','datenum'); [lo,i] = ismembertol(AOD_440(:,1),A,1,'DataScale'...

35 minutos ago | 0

Answered
Help me with this problem
Theta = 75; % degrees va = 600; % km/h vb = 500; % km/h v_b_to_a = vb*exp(1i*(Theta/180 - 1)*pi) - va; V_b_to_a = abs(v_...

alrededor de 2 horas ago | 0

Answered
Making a vector out of all even and odd numbers using for, if
lo = logical(mod(vect,2)); vect_even = vect(~lo); vect_odd = vect(lo);

alrededor de 3 horas ago | 0

Answered
what loop to use to make the code\input repeat again ?
while true a=5 ; disp(' '); i = input('choose a number '); disp(' '); if i == a disp ('RR'); ...

alrededor de 7 horas ago | 0

Answered
how to replace the element with random number based if statement
mutC = mut1; [m,n] = size(mut1); pm = 0.5; rmi = rand(m,n); rCm = rbC+(raC-rbC).*rand(m,n); for i = 1:numel(mut1) if r...

alrededor de 9 horas ago | 1

| accepted

Answered
How to write only non-NaN columns into Excel
T_in_Excel = T1(:,any(~isnan(T1{:,:}))); writetable(T_in_Excel, File_W)

1 día ago | 0

Answered
replace duplicate value by 0 in matrix or vector
b = [1 2 1 3]; [a,c] = unique(b,'first'); out = zeros(size(b)); out(c) = a;

1 día ago | 0

Answered
Could anyone help me with a code to check if the time intervals intersect
M = sortrows(list); out = M(sum(squeeze(any(M - permute(M,[3,2,1]) <= 0,2))) == 1:size(list,1),:);

1 día ago | 0

| accepted

Answered
concatenate arrays after performing addition
A = [1,2,3;4,5,6;7,8,9]; B = [2,3,4,5]; D = reshape(permute(A + reshape(B,1,1,[]),[2,1,3]),size(A,2),[])';

1 día ago | 0

| accepted

Answered
classify array elements without so many if statement
out = discretize(A,0:.5:8)

1 día ago | 0

| accepted

Answered
Get index of smallest vlaue in each cell of cell array
Let cell_array - your cell array (40 x 1). cellfun(@(x)find(min(x) == x),cell_array)

1 día ago | 2

| accepted

Answered
could anyone help me how to update the array values with respect to the following arrays
a = (1:max(C))'; b = accumarray(C,1); i = a(accumarray(C,1) > 1); [lo,ii] = ismember(C,i); AA = A(lo,:); [iii,j] = ndgrid(i...

1 día ago | 0

Answered
Create a matrix on the basis of other matrix
[~,j] = find(M); C = accumarray(j,M(M ~= 0),[],@(x){unique(x,'stable')}) if all(diff(cellfun(@numel,C)) == 0) C = [C{:}];...

2 días ago | 0

Answered
How to specify a number to the specified position in the array?
a = [2 3 5 7 11]; out = [a;flip(a,2)]; out = out(1:numel(a));

2 días ago | 0

| accepted

Answered
Return a vector with the same size as the indexing matrix/vector (code optimization)
General case: out = reshape(V(index),size(index)); For your case V - vector (n x 1): if size(index,1) == 1 out = V(index...

2 días ago | 1

Answered
Question about column operator vectors
Use vec = -1:-1:-5 or vec = -(1:5)

2 días ago | 0

Answered
Finding and counting of identical rows in a matrix
For Octave? M = [ 1 300 3500 500 6000 3 200 3000 500 6500 5 150 2500 450 6000 8 400 2000 550 5500 5 200 3000 500 6500 ...

5 días ago | 1

| accepted

Answered
Collect double values of a matrix
Let xyz - your array (n x 3); [~,~,c] = unique(xyz(:,[1,3]),'rows','stable'); % c - serial numbers of rows with same values in ...

7 días ago | 0

Answered
Another Datetime conversion problem!
DateStrings = '2019-10-04T11:41:06+01:00'; convertDATETIME=datetime(DateStrings,'InputFormat',... 'uuuu-MM-dd...

7 días ago | 0

| accepted

Answered
Finding consecutive data with non zero in array
for R2013a (and for your data from all_data.txt) f = fopen('all_data.txt'); Data = textscan(f,'%f %f %f %f %f %f %f','CollectO...

11 días ago | 0

| accepted

Answered
Rearrange randomly just some parts of an array
C = [1 2 1 2 1 2 1 2 4 2 4 2 4 2 4 2 6 2 6 2 6 7 6 7 6 7 6 7 7 7 7 7 8 8 8 8 9 9 9 9 ]; CC = [C(:);max(C(:))+1]; j = 1; for...

13 días ago | 0

| accepted

Answered
Delete some specific numbers from an array
A = [10 9 5 5 7 3 5 8 3 5 6 3 7 10 ]; B = sign(diff(A(hankel(1:3,3:numel(A)))',1,2)); out = A( [true; prod(B,2) ~= 1 ; true...

13 días ago | 0

Answered
Help creating a vector in a loop
n = numel(A); new_vector = zeros(25,n); for ii = 1:n new_vector(:,ii) = linspace(A(ii),B(ii),25); end

14 días ago | 0

Answered
Subscript indices must either be real positive integers or logicals. how can i change? thanks!
ii(1) = v0; %initial condition for loop=2:N %recursive ii(loop) = ii(loop-1) + Vs*dt*/L - ii(loop-1)*R/L; end

14 días ago | 0

Answered
How to randomly place ones in specified postions of a matrix?
1. k = 10; [m,n] = size(A); [i1,j1] = ndgrid(1:m,1:2); [i2,j2] = ndgrid(1:3,3:n); ii = sub2ind([m,n], [i1(:);i2(:)],[j1(:);...

14 días ago | 0

| accepted

Answered
Error in Vector Multiplication of Complex Numbers
>> [a,b]*[a;b] ans = -3 >> [a,b]*[a,b].' ans = -3 >> [a,b]*transpose([a,b]) ans = -3 >> [a,b].' ans = ...

15 días ago | 0

| accepted

Answered
How to calculate averaged values from 5-min interval values
T = readtable('parko_hourly_1_1_2015_eos_16_5_2015_T_RH MINE.xlsx','sheet','Φύλλο1'); T = T(~isnan(T.minute),[1:5,7:8]); T.YEA...

15 días ago | 0

Answered
how to apply two statement in if loop?
if all(A(:)>0) & all(ismember(A(:),B(:))==0) .. end

16 días ago | 1

| accepted

Answered
Rearrange elements in an array based on another array
s = sum(M,2); v = V.*(M == 0); ss = s - sum(v,2); lo = ss > 0; n = sum(v == 0,2); a = fix(ss./n); b = mod(ss,n); add = ar...

20 días ago | 0

| accepted

Answered
Matrix from an array
A=1:15; n = 6; k = 3; m = numel(A); B = A((1:k:m - n + 1)' + (0:n-1)); % for old MATLAB < R2016a B = A(bsxfun(@plus,(1:k...

20 días ago | 1

| accepted

Load more