Community Profile

photo

Akira Agata


MathWorks

481 total contributions since 2016

Contact

Akira Agata's Badges

  • 12 Month Streak
  • Knowledgeable Level 4
  • Pro
  • Solver
  • Revival Level 2
  • First Answer

View details...

Contributions in
View by

Answered
I cannot get the output, Image processing
I think several points should be checked: File path in the line 1 is correct? 3rd input argument of imnoise function should b...

2 giorni ago | 0

Answered
How to remove triangles from an image?
How about the following? % Read the original image I = imread('image.jpg'); % Extract orange part (using Color Thresholder ...

6 giorni ago | 0

Answered
Convert distance matrix to a table
Or, if you want the full list of (from, to, distance) set, how about the following? rng('default') % For reproducibility X = r...

8 giorni ago | 0

Answered
creating a cell with serial names
How about the following? suffix = repmat({'AB_'},15,1); number = cellstr(num2str((1:15)','%02d')); output = strcat(suffix,n...

8 giorni ago | 0

Answered
Interpolation of a scatter plot
Seems that scatteredInterpolant function would be better. Here is an example. % Read data file T = readtable('data.xlsx'); ...

8 giorni ago | 0

| accepted

Answered
Extracting a specific number from an excel cell
How about the following? [~,~,C] = xlsread('yourExcel.xlsx'); C = extractBetween(C,'(',')'); C = extractAfter(C,' '); data...

19 giorni ago | 0

| accepted

Answered
Create a function and plot it
There are two ways to do this. [Solution 1] a = 500; x = 1:1000; fx = 1 + (a ./ (2.5 + x)); figure plot(x,fx) [Solu...

19 giorni ago | 1

| accepted

Answered
Row/column-wise logical indexing
How about the following solution? B = arrayfun(@(k) A(L(:,k),:), 1:size(L,2), 'UniformOutput', false); Then, your can obtain c...

20 giorni ago | 0

Answered
Why is theta=0 not on top
After "Ax = gca;" in your code, please add the following two lines. Ax.ThetaDir = 'clockwise'; Ax.ThetaZeroLocation = 'top';

21 giorni ago | 0

| accepted

Answered
How to obtain exponential equation parameter from probplot function?
I believe fitdist function should be some help.

28 giorni ago | 0

| accepted

Answered
how do I run a .exe within a .m file?
You can use system function to run a .exe. For example, if you save the following line in .m file and run in MATLAB on Windows P...

28 giorni ago | 0

| accepted

Answered
How to add labels to an array or table (after conversion from an array)
This is because some characters (such as '/' ) and white space ' ' are not allowed to use as variable names in table. Also, each...

28 giorni ago | 1

| accepted

Answered
How to print 1x50 array into a text file
How about the following? dlmwrite('output.txt',reshape(A(1:48),8,6)','delimiter','\t'); dlmwrite('output.txt',A(49:50),'-appen...

circa un mese ago | 1

Answered
How to remove or identify spikes in a random signal.
Looking at your data, negative spikes you mentioned is always less than 1000. So, if this condition is applicable to other data,...

2 mesi ago | 0

| accepted

Answered
How to put the values into the specific area and put color
You don't need to use for-loop. The following is one possible solution. A = zeros(70); % Sample 168-by-1 random array with 1...

2 mesi ago | 0

| accepted

Answered
How to avoid the repetition of events ?
How about using unique function? p = [6 4 2 3 1 17 17 21 21 27]; p = unique(p,'stable'); The output becomes like this: >> p ...

2 mesi ago | 0

Answered
How to specify line color using a hexadecimal color code
It would be due to your MATLAB version. Hexadecimal color code can be used in the latest version (R2019a). If your version is R...

2 mesi ago | 0

| accepted

Answered
Extract rows in one array based on time values in a another array +20 seconds
Simple and straight-forward way would be like this. Just in case, I have saved your truncated example of array A and B as .mat ...

2 mesi ago | 0

| accepted

Answered
HOW TO CONVERT A PNG IMAGE IN TO A EPS IMAGE?
Like this? % Read png file I = imread('peppers.png'); % Show the image figure imshow(I,'Border','tight') % Save as eps...

2 mesi ago | 0

Answered
How to mask out the object in the image?
How about the following? % Read and binarize your image I = imread('ms.jpg'); Igray = rgb2gray(I); BW = imbinarize(Igray); ...

2 mesi ago | 0

Answered
Find at least 5 consecutive values above a certain threshold in a vector?
If there are 2 or more consective values above the threshold, the following is one possible solution. (* The following needs Im...

2 mesi ago | 1

Answered
How to make a rainbow in MatLab?
One possible way: t = linspace(0,pi)'; x = cos(t); y = sin(t); color = jet(7); figure hold on for kk = 1:7 plot((2+k...

2 mesi ago | 0

| accepted

Answered
noise removal from image
If the noise is exactly horizontal, one straight-forward solution would be like this: % Read your image and convert it to gray-...

2 mesi ago | 0

| accepted

Answered
How to find the last nonzero entry in all rows of a sparse matrix?
How about the following? [Solution 1] A = [1 3 0 0 0 0;0 4 2 3 0 0;5 0 0 1 4 0]; pos = nan(size(A,1),1); for kk = 1:size(A...

3 mesi ago | 0

| accepted

Answered
making an array to skip missing data for mean calculations
If you want to calculate mean value for each column with ignoring -999 value, how about the following solution? % Assuming your...

3 mesi ago | 0

Answered
How to group a matrix based on height
If you have Image Processing Toolbox, you can do this task easier by using bwlabel function. The following is a simple example. ...

3 mesi ago | 0

Answered
Spline interpolation is giving me errors with array index
At least the latest version R2019a, your code works well. Anyway, I would recommend adjusting vector direction of t and xx, lik...

3 mesi ago | 0

Answered
how to Interpolate hourly data
Hmm, interesting problem. I think the following is one possible straight-forward solution. % Read data file D = dlmread('test...

3 mesi ago | 1

Answered
split a rectangular matrix
How about the following? input = [1 0 0 0; 0 1 0 0; 0 0 1 0]; output = zeros([size(input),size(input,1)]); for kk = 1:siz...

3 mesi ago | 1

| accepted

Answered
how do I plot this vector graphs?
The vector plot for the problem 1-(a) will be like this. Now, I would recommend trying to do the same thing for the remaining pr...

3 mesi ago | 0

Load more