Community Profile

photo

Andrei Bobrov


4 847 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 check ismember in a cell in Matlab?
result = cellfun(@(x)all(x == B{:}),List);

19 jours ago | 0

Answered
Solving an equation with one variable
syms q a t E k1 k2 y eq = (q*a^4/(E*t^4)) == k1*y/t + k2*(y/t)^3; sol = solve(eq,y,'MaxDegree', 3);

20 jours ago | 0

Answered
Reshaping 2d array
As in comment by Sebastian Bomberg's (for MATLAB >= R2016b): % Let A - your data of energy (150120 x 5 double) TT = array2time...

21 jours ago | 0

| accepted

Answered
Matrix multiply with a function
i = [1:3;2,3,1;3:-1:1]; k = [.5;.78;.1]; f = [3;4;8]; d=[2 3 4;7 2 5;1 2 5]; l = k(i).*d + f(i); or l = kron(k(i),d) + k...

21 jours ago | 1

| accepted

Answered
Combination of 4 Element
bl = cellfun(@(x)x(:)',bl,'un',0); n = numel(bl); ii = cell(n,1); for i = 1:n ii{i} = num2cell(nchoosek(1:4,i),2); end...

21 jours ago | 0

Answered
Vectorisation of code for insertion of n x n matrices in a 3D array along the diagonal of a large matrix
A = full(gallery('tridiag',Z(n,1,:),cat(3,Z(1,1,1),Z(n,n,1:end-1)+Z(1,1,2:end),Z(n,n,end)),Z(1,n,:)));

22 jours ago | 0

Answered
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 3-by-3.
A = kron(diag([1 1],1),I) + kron(diag([1 1],-1),I) + kron(eye(3),T);

22 jours ago | 0

Answered
combinations with 2 columns
Combination = fullfact([2 2 2]);

22 jours ago | 0

Answered
How to select every nth value with the last value fixed from a column?
a = original_vector([100:100:4901,4901]);

22 jours ago | 0

Answered
Integrating function of t over numerical values
F = str2func(vectorize(FUN)); Q = integral(F,0,6);

22 jours ago | 0

Answered
How can I sort a matrix elementwise ?
A = [3, 4 ; 6, 2]; [m,~] = size(A); [B,i] = sort(A(:)); index = [mod(i-1,m) + 1, ceil(i/m)];

22 jours ago | 0

| accepted

Answered
How can I find the exact value of the corresponding point in specific longitude and latitude?
load('data.mat');load('lat.mat');load('lon.mat');load('xy.mat'); F1 = scatteredInterpolant(LAT,LON,data) F2 = scatteredInterpo...

25 jours ago | 0

Answered
Evaluation of function handler
F = F(x,y)x + y; FF = @(x)F(x,2);

25 jours ago | 0

Answered
how to covert matlab time to actual time
T = readtable('SMPS1.xlsx','Sheet','Data','Range','1:481'); T.Time = dateshift(datetime(T.Date,'InputFormat','MM/dd/uuuu') + se...

25 jours ago | 0

| accepted

Answered
Generating Daily Values using Hourly Values
T = readtable('your_xlsx_file.xlsx'); t = datetime([T{:,1:4}, zeros(size(T,1),2)]); TT = timetable(T{:,end},'RowTimes',t) ; T...

25 jours ago | 1

| accepted

Answered
how can I find a specific data in time table in matlab?
i = diff(3*(data_mean_daily.tabrizmat7 < -3) + (data_mean_daily.tabrizmat7 > 1)) == -2; T_out = data_mean_daily([i;false]|[fals...

25 jours ago | 0

| accepted

Answered
Convolution Coding in Matlab
h = conv(f,g,'valid')

25 jours ago | 0

| accepted

Answered
Display char matrix vertically
volt = [18 33 31 34 15 37 10.5 48 50 38 35 39 42 33 31 1 5 9 13 11 27 35 -1 46 22 6 19 36]; edges = -40:10:0; [~,~,j] = histco...

25 jours ago | 0

Answered
Replace Number array with characters
volt = [18 33 31 34 15 37 10.5 48 50 38 35 39 42 33 31 1 5 9 13 11 27 35 -1 46 22 6 19 36]; edges = [-inf,0:10:40,inf]; frui...

25 jours ago | 0

Answered
How to include a switch statement within a for loop?
% Parameters a_R = 0.0325; a_T = 0.0325; N_T = 164; N_R = 10; mu_0 = 4*pi*(10^-7); f_Array = [10000,20000,40000]; w = 2*p...

26 jours ago | 0

| accepted

Answered
Integers without repeating consecutively
function [repPos, pinCodeFix] = pinCodeCheck(pinCode) lo = [true;diff(pinCode(:)) ~= 0]; repPos = find(~lo); pinC...

26 jours ago | 0

Answered
How can I insert a smaller ones matrix into a larger zeros matrix?
AA = [5:12;ones(5,1)*[0 8 8 8 0 5 5 5]] AA(end-1:end,1:5) = 1; AA(4,7) = 7; eq7 = AA == 7; le7 = AA <= 7; gt7 = AA > 7; ...

26 jours ago | 0

Answered
Averaging the data from a 3d matrix and populating it in a 2D matrix.
B = mean(A,3);

26 jours ago | 0

| accepted

Answered
Filtering rows of a table by giving a constraint to a particular column
FiltereddataofTable = A(A.Alpha > 100,:);

26 jours ago | 0

| accepted

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

27 jours ago | 0

| accepted

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

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

27 jours 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'); ...

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

27 jours 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)

28 jours ago | 0

Load more