Community Profile

photo

Akira Agata


MathWorks

527 total contributions since 2016

Contact

Akira Agata's Badges

  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 3
  • First Submission
  • 24 Month Streak
  • Guiding Light
  • Knowledgeable Level 4
  • Solver
  • Revival Level 2
  • First Answer

View details...

Contributions in
View by

Answered
grouping numbers in matrix
More generalized solution would be: C = splitapply(@(x){x'}, B, A); If each group has the same number of elements, the followi...

alrededor de 8 horas ago | 0

| accepted

Answered
how to multiply a number in even rows of matrix?
Please try the following: output2(:,2:2:end) = 2;

2 días ago | 0

| accepted

Answered
4d plot in order to create a surface with density from 4 vectors ( coordinates of the dots). X, Y, Z and C is the color.
OK. Then, how about the following? % Load data load('object.mat') % Create meshgrid [xq, yq, zq] = meshgrid(min(x):5:max(x...

3 días ago | 0

| accepted

Answered
4d plot in order to create a surface with density from 4 vectors ( coordinates of the dots). X, Y, Z and C is the color.
How about simply using scatter3 function, like: load('object.mat') figure scatter3(x,y,z,[],c,'.') colorbar

4 días ago | 0

Answered
regionpropsの応用について。
bwboundaries 関数を使うのはいかがでしょうか? たとえば以下のようにオブジェクトの境界をトレースできます。 % Sample binary image I = imread('toyobjects.png'); BW = ~imbina...

15 días ago | 0

Answered
ignore or delete number or row has been multiply defined?
Simple solution will be: result = unique(yourArray); If you want to keep element's order, please try the following: [~, ia] =...

19 días ago | 0

| accepted

Answered
Timetable Monthly Average over Many Years
Looking at your csv data, some additional options will be needed. (1) To specify the delimiter in your csv data, 'Delimiter' op...

21 días ago | 1

Answered
change numbering inside cell
Solution 1: c_new = cell(size(c)); for kk = 1:numel(c) c_new{kk} = interp1(B(:,2),B(:,1),c{kk}); end Solution 2: % "...

21 días ago | 0

| accepted

Answered
Extract integer number from a cell array.
If my understanding is correct, you are trying to extract numbers just after 'BUS'. If so, how about the following? % Original...

21 días ago | 0

| accepted

Answered
Graph each side of the equation
How about using fzero function? The following is an example: % fnc = (left side) - (right side) fnc = @(x) 4.231*x - exp(-0.17...

23 días ago | 1

| accepted

Answered
How can I set a descend order finding peaks to my graph ?
How about combining envelope and findpeaks functions? The following is an example. % Load data load('signal.mat'); load('t.m...

27 días ago | 2

| accepted

Answered
How to take monthly flow data and obtain annual max flow values
Assuming your data was stored in 972-by-2 matrix yourData, following code can do your task. year = repelem([1:81]',12,1); year...

27 días ago | 0

Answered
Remove the border lines.
How about using surf function with 'FaceColor' = 'interp' option, instead. Here is an example. figure surf(xx1,yy1,z1,'FaceCo...

alrededor de 1 mes ago | 0

Answered
how to count daily events from a time series data
How about the following? % Read your text data file T = readtable('test.txt'); % Create datetime vector Time = datetime(T....

alrededor de 1 mes ago | 0

| accepted

Answered
Extracting coordinates values for the line.
How about the following? % Load data and convert to gray-scale image load('v.mat'); Igray = mat2gray(v); % Apply multileve...

alrededor de 1 mes ago | 0

| accepted

Answered
Kmeans (Initialise centroids)
Like this? % Apply k-means clustering to data set X (e.g num of classes = 2), and obtain centroids C numClass = 2; [cluster,C...

alrededor de 1 mes ago | 0

Answered
plotを使った四分木分割をしたいです。
Image Processing Toolboxの関数 qtdecomp を使うのはいかがでしょうか。 以下はその一例です。 % 与えられた(x,y)座標が1(他は0)の16x16配列Iを作成 a = [2 2; 7 2; 3 7; 6 6; 8 9...

alrededor de 1 mes ago | 1

| accepted

Answered
connect median in a boxplot
Like this? % Sample data Data = randn(100,10); % Calculate median for each column med = median(Data); % Visualize the r...

alrededor de 1 mes ago | 0

| accepted

Answered
Return index of datetime column in a table
If your HData.Time column is string: % index of zero seconds idx_s = cellfun(@(x) ~isempty(x),regexp(HData.Time,'00$','match')...

alrededor de 2 meses ago | 0

| accepted

Answered
surf plot from text file
Like this? data = dlmread('exportfilecst4.txt'); x = data(:,1); y = data(:,2); z = data(:,6); figure surf(reshape(x,31...

2 meses ago | 1

| accepted

Answered
retime only for specific gaps on time
How about the following solution? % Sample timetable with 2 gaps (e.g >1 hour) Time = datetime('now') + minutes(cumsum(45*rand...

2 meses ago | 2

| accepted

Answered
How to assign points to multiple polygons using inpolygon
Looking at your data, one of the Points is outside of the convex hull of polygon A's coordinates. So "inpolygon" function will n...

3 meses ago | 0

Answered
三角形膜要素の分布図(任意の(x,y)座標で)を作成したいのですが、方法はありませんでしょうか。
ご説明ありがとうございます。おおよそ理解しました。 まず、任意の (x,y) 座​標に対して何らかの値 z (例えば関数 z = f(x,y) の出力値)があったとして、それらの隣接する点どうしを三角形で結んで3次元曲面として表示するには、以下のようにす...

3 meses ago | 1

| accepted

Answered
How can I convert multiple images (all the same size) into one matrix?
To create image dataset for training a neural network, imageDatastore should be an easy and promissing way. So I would recommend...

3 meses ago | 0

Answered
How to stretch matrix
Not so sophisticated, but intuitively clear way: y = repelem(x,2); y(2:2:end) = y(2:2:end)+1;

3 meses ago | 1

Answered
Trouble importing similar .txt files using readtable (error: all lines must have the same number of delimiters)
I think the following way would be more stable. % Read data fid = fopen('Error.txt','r'); str = textscan(fid,'%s','Delimiter'...

3 meses ago | 1

| accepted

Answered
How to detect change in mean value of a signal
It may need to apply "smoothing" before detecting changes larger than 10,000. Looking at your data, ~2000 points movmean will cl...

3 meses ago | 0

| accepted

Answered
Checking if word/words are present in a sentence in a table cell.
Like this? % A sample data T = cell2table({... 'M3 TRIPPED xyz','abc','pqr';... 'def','M3 TRIPPED 123','ghi'}); % Fin...

3 meses ago | 1

Answered
Looking for the ways to categorize the black dots by the number of pixels...
I strongly believe the regionprops function will be your help. The following is an example: % Read image and binarize I = imre...

3 meses ago | 0

| accepted

Answered
積み上げグラフのcolormapについて
たとえば以下のような方法ではいかがでしょうか? % Sample data and color map y = rand(3,10); color = colorcube(size(y,2)); % Visualize the data fi...

3 meses ago | 1

| accepted

Load more