Community Profile

photo

Andrei Bobrov


4,575 2011 年以降の合計貢献数

Andrei Bobrov's バッジ

  • Master
  • 36 Month Streak
  • Thankful Level 2
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer
  • Scavenger Finisher
  • CUP Challenge Master
  • Commenter
  • Leader
  • Speed Demon
  • Solver

詳細を表示...

貢献した分野
表示方法

回答済み
Attempting to automate the importing of text file data
%Let directory 'data' have your files: 40_8deg_HL_Both.txt and 40_4deg_HL_Both.txt n = dir('path_to_data/data/*Both.txt'); m =...

3日 前 | 0

| 採用済み

回答済み
How can I convert cell contents to a matrix?
T = readtable('40_8deg_HL_Both.txt','ReadVariableNames',false,... 'Format','%{yyyyMMdd hh:mm:ss.SSS}D %f %f %f %f %f %...

4日 前 | 1

| 採用済み

回答済み
How can i store values calculated in my loop
X = [9 20 15 9 10 5;5 20 5 20 15 3;15 29 39 49 5 10]; [rows, columns]=size(X); for r=1:columns for k=1:3 if X(k,...

5日 前 | 1

回答済み
count the quantity of prime number before my number
x=input('Input a positive integer, or 0 to quit: '); z = [2,3:2:x]; y= mod(z(:),z(:)'); out = z(all(tril(y) + triu(ones(siz...

5日 前 | 0

回答済み
How to create a matrix using conditional statements in a loop based in another matrix
H = all(Comb,2).*sum(Comb,2);

5日 前 | 1

| 採用済み

回答済み
Find the first element that satisfy a condition in a vector
function [summa, index] = max_sum(A,n) B = movsum(A(:),[0 n-1]); summa = max(B); index = find(summa == B); end ...

5日 前 | 0

| 採用済み

回答済み
How to plot matrix inside for loop ?
A = [0 3/10;3/5 0]; u = [0.3 ;0.8]; p = [0;0]; P = zeros(2,50); for n = 1:50 p = A*p + u; P(:,n) = p; end plo...

5日 前 | 1

回答済み
How to group an array and then replace each group with different numbers?
B = A; B(A==0) = repelem(C,diff(reshape(find(diff([1,A,1]) ~= 0),2,[])));

5日 前 | 1

| 採用済み

回答済み
Center of gravity between 2 points
x = [1 3]; y = [2 5]; v = [10 20]; xc = sum(v.*x)/sum(v); yc = sum(v.*y)/sum(v);

6日 前 | 0

| 採用済み

回答済み
How to replace some values in an array with zero and some with values from another array?
A = [2 4 0 0 5 3 0 2 1 0 2]; B = [1 1 0 1]; A1 = ~A; C = double(A1); C(A1) = B;

6日 前 | 0

回答済み
Combining vectors [1 2 3 4 5] and [2 3 4 1 5] to [12 23 34 41 55]
A = [1 200 3 4 5]; B = [23 3 445 10 54]; out = str2double(string(A)+B); or out = A.*10.^(floor(log10(B))+1) + B;

6日 前 | 0

回答済み
Vectorize a for loop
Solution for attached data: [~,sheets] = xlsfinfo('MapList.xlsx'); n = numel(sheets); ml = cell(n,1); for ii = 1:n ml{i...

6日 前 | 0

回答済み
How to make the main diagonal and the diagonal above and below the main diagonal equal to -2 and 1 respectively
A = gallery('tridiag',100,-1,2,-1); or n = 100; A = spdiags(ones(n,1)*[-1 2 -1],-1:1,n,n);

6日 前 | 1

回答済み
Vectorize a for loop
Please attach your data (bimage,map.xlsx - small example) as mat-file and xlsx-file. ml = zeros(200,2,66); for ii = 1:size(ml,...

6日 前 | 0

回答済み
how to make a column vector with evenly spaced entries with different coefficients
k = -4:-1; y = 3; n = numel(k); y = [zeros(n-1,n);y*k(:)']; ycoeff = y(:); or k = -4:-1; y = 3; n = numel(k); ycoe...

10日 前 | 0

| 採用済み

回答済み
Convert an array of numbers into letters using logical indexing
v = [0, 5:.5:10]'; S = string(cellstr(('F':-1:'A')')); K = S(4:6)' + {'-','','+'}'; K = [S(1:3);K(1:end-1)']; out = discret...

10日 前 | 0

回答済み
How do I compute 3 minute moving average in timeseries?
Let ts - your timeseries object. k = 3*60/2; % the number of elements corresponding to three minutes in your case ts.Data(:,2)...

11日 前 | 0

回答済み
I have a huge matrix to A to solve for Ax=B. There are some rows with zero elements in A and I want to modify the diagonal for these rows. So how can I fast find these rows with all zero elements? for loop is rather slow.
"How to set diagonal as 1 for the row with all zero elements?" A = A + diag(~diag(A)); or n = all(A==0,2); A = A + diag(n); ...

12日 前 | 0

回答済み
Convert hourly to daily data
T = readtable('IT_GR_data.csv','ReadV',1); T.Properties.VariableNames{1} = 'Date'; TT = table2timetable(T,'RowTime','Date');...

12日 前 | 0

| 採用済み

回答済み
How to solve this loop equation
data = readtable('data.xlsx','ReadV',0); data.Properties.VariableNames = {'a','b'}; m = 0:.01:1; [ii,idx] = ndgrid(m,1:heig...

12日 前 | 1

| 採用済み

回答済み
Values of vectors in matrix (changes in time)
t =0:pi/20:4*pi; x =reshape(cos((1:4)'*t),2,2,[]);

14日 前 | 1

回答済み
I need help with for loops with if statements. I'm trying to get it to output [P,O,O,O,P​,O,P,U,U,O​,O,O,U,O,O​,A,A,A,P,P​,G,O,U,U,G​,A,P,O]. thx
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]; ABS = sprintfc('%c','UAPGOU'); [~,...

14日 前 | 1

回答済み
find frequency and duration of numerical events in a matrix
Let A - your array (1440 x Days): k = 60;% k = 60 (minuties in hour) [m,n] = size(A); a1 = A ~= 0; A1 = diff([false(1,n);a1]...

18日 前 | 0

| 採用済み

回答済み
How to take 3 elements at a time from an array and turn them into their own column vector?
msg = 'gfewqaxcvbhgf'; % example [~,C] = ismember(msg,'a':'z'); C = C - 1; out = reshape([C(:);zeros(mod(-numel(C),3),1)],3...

18日 前 | 1

| 採用済み

回答済み
How to use 'for' in this example?
a = [y11(:)';y22(:)';y33(:)';y44(:)';y55(:)';y66(:)']; aaa = reshape(repelem(a,1,2),1,[]);

20日 前 | 0

| 採用済み

回答済み
Finding the first and the last elements of consecutive numbers and combining them with a semi colon.
ii = cumsum([true,diff(outliers)~=1]); A = accumarray(ii(:),outliers(:),[],@(x){[min(x),max(x)]}); out = reshape([A{:}],2,[])'...

20日 前 | 1

| 採用済み

回答済み
Interating through a table data set
sex = {'F';'M'}; age = [55;40]; [~,~,ii] = histcounts(age,agetable.agelow); [lo,jj] = ismember(sex,{'F','M'}); at = agetab...

20日 前 | 0

| 採用済み

回答済み
Only the value corresponding to the last loop of a for loop being saved in the output array
c = 12000; k = (1:20)'; soc = k*c/numel(k); lo = ismember(round(data(:,16)),soc); ocv = data(lo,14);

20日 前 | 1

| 採用済み

回答済み
How to randomly interchange values in different rows in a matrix
[m,n] = size(A); At = A.'; [~,ii] = sort(rand([n,m])); cutpoint = find(ii == 1); i0 = zeros([n,m]); i0(1,:) = 1; i0(ccutpo...

20日 前 | 0

回答済み
HOW TO CREATE THİS MATRİX
hankel(0:99,(0:99)+99);

20日 前 | 0

Load more