Community Profile

# Andrei Bobrov

4,353 total contributions since 2011

View details...

Contributions in
View by

Sum individual elements of rows that have identical elements in other rows
A = [19980227 0.100000000000000 0.0675470000000000 13.7500000000000 0.0704000000000000 0.000100000000000000 -0.001300000000000...

1 day ago | 0

| accepted

How to plot intergratoion results into a table
out = table(tt,arrayfun(@(t0)100 - integral(@(tt)8*exp(-.1*tt),0,t0),tt),'v',{'Time','data'});

1 day ago | 0

Numerical Sorting of Cell Matrix by Single Column
A = { 'Wt0,4_Bw8,3_Bt0,4_Ah15_Aa0' '158.6' '9653.1008' '11' 'Wt0,4_Bw8,3_Bt0,4_Ah15_Aa10' '158.6' ...

1 day ago | 2

| accepted

how to convert data from minute to hourly average
dir1 = 'path_to_folder_with_your_txt_files'; f = dir(fullfile(dir1,'iisc*.txt')); nm = {f.name}'; dt = datetime(regex...

1 day ago | 1

| accepted

Convert a symbolic vector to a list of scalar outputs for a function created by matlabFunction
n = 5; c = sym('c',[n,1]); jacf= matlabFunction(jacobian(prod(c)),'v',{c}); use >> c = 1:5; >> jacf(c(:))...

1 day ago | 1

| accepted

Flip a vector using for
out = flip(yourvector); with loop (no use) out = zeros(size(yourvector)); k = 1; for ii = numel(yourvector):-1:1...

2 days ago | 0

how can i take average of matrices in a cell?
A - your cell array one variant [m,n,k] = size(A{1}); [h,l] = size(A); A1 = reshape(cat(3,A{:}),m,n,k,h,l); out...

2 days ago | 0

| accepted

How to normalize a matrix of dimension 450×40
|A| - your array Amin = min(A(:)); out = (A - Amin) / (max(A(:)) - Amin);

2 days ago | 0

Mean calculation from nxm matrices using nxm index matlab
out = [(1:12)',accumarray(Month_data(:),flow_data(:),[],@mean)];

2 days ago | 0

Non-loop comparison of 3 - D matrices using "find"?
Let A - your 3-D matrix with size that is 21 x 751 x 1500 B - your "flag" array with size that is 1 x 751 x 1500 for |MA...

5 days ago | 0

How to place NaN at diagonal position in cell array?
a={[],-1,-1,0.8,-0.7,[],[]; [],[],0.9,1,[],-0.9,0.6; -1,[],[],0.9,0.2,[],0.8}; [m,n] = size(a); z = sort([repmat(...

11 days ago | 0

| accepted

comparing elements of a cell array based on another cell array
a1 = {[2,5];[1,3,4]}; a2= {[1,4],[1,5],5,4,[3,5,2]}; n = numel(a1); out = cell(n,1); nn = cellfun(@numel,a2); ...

11 days ago | 0

| accepted

how to implement the following table contents in N-dimensional lookup table?
function out = Error_status(Psi,Te,Sector) [T,S,ps] = ndgrid([1, 0, -1],1:6,0:1); x(:,:,1) = string( {'110' '...

11 days ago | 1

Attempt to reference field of non-structure array.
Maybe this? x=2; D=[1 0 1 0]; X=[1;x;x.^2;x.^3]; dx=D*X; gx=1+x+x.^3;

11 days ago | 0

Reshape matrix in the desired form
a = [1 2 3 4] ; b = [5 6 7 8] ; B = [repmat(a,1,4);repelem(b,4)]; or reshape(permute(A,[2,1,3]),[],2)';

14 days ago | 0

How can I skip some rows in Matlab ?
out = You_array(1:2:end,:);

14 days ago | 1

| accepted

Parsing a data set into multiple arrays based on value?
a = randi(10000,20,1); % Let a - your array lo = a >= 1000; ii = cumsum(diff([0;lo(:)]) == 1); out = accumarray(i...

15 days ago | 0

| accepted

How to process a large matrix of size 28x28x11684?
Just: z = sort(a); With loop: k = size(a,3); z = a; for ii = 1:k z(:,:,ii) = sort(a(:,:,ii)); end

15 days ago | 0

| accepted

How can I vectorize this function with nested FOR loop?
% MATLAB >= R2016b z = - 20 * exp( - 0.2 * sqrt( .5 * sum( x(:).^2 + y(:)'.^2 ) ) ); % MATLAB <= R2016a [...

15 days ago | 2

| accepted

How to get values in an 8x8x4096 matrix?
Let M - your array [8x8x4096]. One variant: [m,n,k] = size(M); x = [1,2,2]; y = [2,2,1]; out = M(sub2ind([m...

16 days ago | 0

| accepted

Finding neighbour values average of the 2d data set
x1 = floor(x(:))+1; [ii,g] = findgroups(x1); out = [g,splitapply(@mean,y(:),ii)]; Second variant of the output. ...

16 days ago | 1

| accepted

Hi, I would like create a vector using a for loop.
n = 7; P = 1e3; X = P * 1e-3.^(0:n);

16 days ago | 1

Converting 2D matrix to 3D matrix
out = reshape(your_matrix,size_of_your_new_3D_matrix)

17 days ago | 0

| accepted

Why am I getting an error that matrices must agree?
prompt= 'State the Area: '; Area = input(prompt); prompt= 'State the Straight Cost: '; StrCo = input(prompt); prom...

17 days ago | 1

Search matrix for array of values and place results into another
t = ismember(A',B); Ct = C'; ii = sort(t,'descend'); out = double(ii); out(ii) = Ct(t); out(~ii) = -1; out =...

17 days ago | 0

How can I calculate Centriod from a sets of location coordinate value(x,y)?
xy_centroid = mean([X,Y]) or >> T = readtable('your_xls_file.xls'); >> XY_centroid = mean(T{:,:}) XY_centroid = ...

17 days ago | 0

| accepted