Community Profile

# Akira Agata

### MathWorks

582 total contributions since 2016

View details...

Contributions in
View by

writing in a pre-existing txt file ?
Assuming the pre-existing text file is data.txt, how about the following? cInput = readcell('data.txt','Delimiter','\n'); cA...

2 days ago | 0

How can I extract the harmonic related numbers from a matrix?
How about the following? x = [90 100 110 200 220 250 300 330 340 400 420 500]; tfUsed = false(size(x)); R = x./x'; idx = R...

2 days ago | 0

| accepted

Machine Learning Signal Processing Help
I believe one good starting point would be descriptive statistics listed in this page (Signal Processing Toolbox), or Diagnostic...

3 days ago | 0

splitting dataset into training set and testing set
You can split your dataset by using partition function, like: [setTrain, setTest] = partition(faceDatabase, [0.8, 0.2], 'random...

3 days ago | 0

| accepted

how to create multiple matrix from a single matrix
If you have Image Processing Toolbox, how about the following? % Sample data A = [... 1 2 3;... 4 5 6;... 7 8 9;... ...

11 days ago | 0

| accepted

change color of outlier limit in box plots
How about the following solution? % Sample data x = randn(1000,4); % Create boxplot without outlier markers figure boxplo...

13 days ago | 0

| accepted

how do I add msec to datetime?
Please set the display format to show millisecond, like: >> Ts.Format = 'uuuu/MM/dd HH:mm:ss.SSS'; >> Ts Ts = datetime ...

19 days ago | 0

| accepted

How to replace elements of matrix by elemts from array
Basically, this task can be done by: NewV = reshape(x,8,[])'; But in your case, length(x) can NOT be devided by k (=8). So you...

21 days ago | 0

ファブリペロー干渉計について

21 days ago | 3

| accepted

Overlay curves over heatmap
How about the following way? Plot the heatmap Add axes over the heatmap Plot lines on the axes Set the background color of t...

22 days ago | 1

| accepted

Simplifying an array with repeat values in it

1 month ago | 0

Error in the medical image display
How about the following? imshow(T_1,[]); In addition, I believe the line 'T_1 = squeeze(C);' can be deleted.

1 month ago | 0

| accepted

plotting date from datetime array
'Y' should be a captal letter. Please try: histogram(d.Year)

1 month ago | 0

| accepted

to determine rainfall data
I would recommend using timetable and retime functions, rather than using for-loop. The following is an example: % Read data ...

1 month ago | 0

Cycle counting from 0
How about the following? x = [0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0]; str = num2str(...

1 month ago | 0

How to fit an ellipse to an image in matlab.
How about the following? % Read image I = imread('diskimage1.jpeg'); % Binarize Igray = rgb2gray(I); BW = imbinarize(Igra...

1 month ago | 0

| accepted

Changing gregorian date number to calendar date and time
If your time vector represents hours since 1900-01-01 00:00:00.0 , following code can convert it into yyyy-MM-dd. T = datetime...

1 month ago | 1

| accepted

1 month ago | 1

| accepted

Axes上に表示した画像を傾けたい
axesオブジェクトで、図の真上方向を示す CameraUpVector プロパティを回転させるのはいかがでしょうか？ ちなみに、2次元表示での CameraUpVector プロパティのデフォルト値は [0 1 0] ですが、imshowで画像を表示し...

1 month ago | 1

| accepted

how to generate two random binary images with remove overlapping ?
OK, maybe I could understand your intention. How about the following way? nRow = 5; nCol = 4; while true % Prepare a bl...

1 month ago | 1

| accepted

How to read data after a specific word from txt file?
If your MATLAB is R2019a or later, you can use readcell function. Also, by using indexing technique, you can do your task faste...

1 month ago | 0

How to make this surface?
Straight-foward solution would be like this: x = linspace(0,5); y = linspace(0,2); [xGrid, yGrid] = meshgrid(x,y); zGrid =...

1 month ago | 0

How to swap array element from two arrays conditionally
By using indexing technique, you can simply do this kind of task. The following is an example: % Original matrixes A = [... ...

1 month ago | 1

| accepted

figureの複製方法について
copyobj関数が使えるかと思います。 以下は簡単なサンプルコードです。 x = linspace(0,4*pi); figure plot(x,sin(x)) ax = gca; hFig = figure; copyobj(ax...

1 month ago | 3

| accepted

How can i load .mat files from subfolders with for loop?
How about using dir function? Using the function, the solution would be like this: fileList = dir('C:\Users\**\*.mat'); for...

2 months ago | 0

Rearrange time and turn it into Julian time
How about the following? % Read the csv file D = dlmread('h172.csv'); % Generate datetime vector Time = datetime(D(:,1),D(...

2 months ago | 0

| accepted

how to save digital output
How about using writematrix function? writematrix(a,'a_out.txt','Delimiter',' ');

2 months ago | 0

XY plot data interactively
How about using animatedline function? The following is an example: h = animatedline('LineStyle','none','Marker','o'); axis([...

2 months ago | 0

How do I make a different shape like a hexagon or triangle using image processing?
If you want to create regulay polygon shape image, how about using nsidedpoly function? The folloing is an example: % Create h...

2 months ago | 0