Community Profile

photo

Akira Agata


Last seen: Today

MathWorks

673 total contributions since 2016

Contact

Akira Agata's Badges

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

View details...

Contributions in
View by

Answered
Hi I need help with for loop
No need to use for-loop. How about the following way? % Read data file T1 = readtable('A1_input.txt'); % Postion of (x,y) a...

alrededor de 12 horas ago | 0

Answered
Remove noise from image
How about applying median filter? The following is an example: % Read the image and convert it to grya-scale I = imread('gray...

3 días ago | 0

Answered
任意の空セルに数値を代入する方法を教えてください
例えば、以下のような処理はいかがでしょうか? % Sample cell array (A(1,2) and A(2,2) are empty) A = {'abc',[];123,''}; % Detect empty cell(s) and ...

3 días ago | 0

| accepted

Answered
二次元グラフとそれに対応したカラーバーを表示させる方法
imagesc を使ってデータをヒートマップとして可視化するのはいかがでしょうか? ご参考までに、簡単な例を作成してみました。 % Sample Data x = linspace(0,2*pi); y = 0.01 + sin(x).^2; ...

23 días ago | 1

Answered
How to convert a cell to matrix?
How about the following way? % Convert to numeric array maxLen = max(cellfun(@numel,A)); A = cellfun(@(x)[x, NaN(1,maxLen - n...

27 días ago | 1

| accepted

Answered
join tables by categorical variable
Please try innerjoin or outerjoin functions, like: c1 = innerjoin(a,b,'Keys','Var1'); c2 = outerjoin(a,b,'Keys','Var1','MergeK...

30 días ago | 0

Answered
remove nodes without changing the numbering of nodes
How about setting a nodelabel for each node? The following is an example: s = [1 1 1 2 2 3]; t = [2 3 4 3 4 4]; % Create a...

alrededor de 1 mes ago | 0

Answered
How to change color bar limits in imagesc?
You can do that task by setting CLim of the axes, like: figure imagesc(rand(4)); ax = gca; ax.CLim = [0 1]; colorbar

alrededor de 1 mes ago | 1

| accepted

Answered
why does the sound with different sampling frequency sounds the same ?
That's the basic of the 'Sampling theorem'. As long as frequency component of the signal is less than Nyquist frequency ( = samp...

alrededor de 1 mes ago | 0

| accepted

Answered
fit結果の各項目毎のプロット
関数fitが出力するcfitオブジェクトの中には、近似曲線の各係数が保存されていますので、これを使ってそれぞれのgauss曲線を描画することができます。 % Sample data x = linspace(0,3*pi); y = sin(x).^...

alrededor de 1 mes ago | 0

| accepted

Answered
create a matrix using a vector such that each row is one offset of the previous row
If the output matrix is always N-by-3, the following straight-forward way might be enough: matrix = [v(1:end-2);v(2:end-1);v(3:...

alrededor de 2 meses ago | 0

Answered
plotコマンドを使わずに、新規figureに元のグラフをコピーをする。
copyobj を使うのはいかがでしょうか? たとえばご質問頂いた例では、以下のようになります。 figure ax1 = axes('Position',[0.1, 0.55 , 0.8182, 0.4091]); ax2 = axes('Pos...

alrededor de 2 meses ago | 0

| accepted

Answered
グラフ上の座標の取得
figureのコールバック関数 (WindowButtonDownFcn, WindowButtonUpFcn) を使うというのは、いかがでしょうか? たとえば以下のようにすると、マウスの左ボタンを押した時と解放した時の座標を、それぞれ取得することができ...

alrededor de 2 meses ago | 0

| accepted

Answered
Calculate duration from labeled timestamped data.
Thank you for providing your data. I believe the following is an possible solution. I hope this will be somehow helpful for you...

alrededor de 2 meses ago | 0

| accepted

Answered
How to rescale table columns
normalize function can do that task, like: rescaledTable = normalize(yourTable,'range');

alrededor de 2 meses ago | 0

| accepted

Answered
文字列の置き換えについて
条件の数が、ご質問の例のように3個程度であれば、以下のようにして置き換えることができます。 % (1) Straight-forward solution idx = startsWith(A,"A"); A(idx) = "1"; idx = s...

2 meses ago | 0

Answered
How to clear dots in image
How about the following? [X,map] = imread('4.png'); X2 = medfilt2(X); imwrite(X2,map,'output.png');

2 meses ago | 0

Answered
How to condionally keep unique rows in a table
How about the following? idx = (T.e == 2) & (T.f == 3); T_desired = unique(T(idx,:),'rows'); Or, if your original table T has...

2 meses ago | 0

| accepted

Answered
Best to import and plot one large csv file
How about using "tall array" ? I believe the following pages should be helpful for your task: https://jp.mathworks.com/help/ma...

2 meses ago | 0

Answered
Fill area between plot and the 0-line?
How about using area function? The following is an example: % Sample data x = linspace(0,4*pi,1000); y = sin(x); % Extrac...

2 meses ago | 1

| accepted

Answered
Finding whether the element of the array is present in the other array and finding the index value
Just in case, let me post an example. If you don't need to think about tolerance, intersect function also works. % Example (de...

3 meses ago | 0

Answered
How to find and color circle in a binary image of circles using sliding window through out the image?
Looking at the original image, target regions are filled with plane color. So I tried to apply the entropyfilt to extract the R...

3 meses ago | 1

Answered
選択肢から重複を許して並べる順列のパターンを列挙した行列を作る方法
meshgrid や ndgrid 関数を利用する方法では如何でしょうか? たとえば [0 1] から重複を許して3つ選ぶという例ですと、以下のようになります。 [x1,x2,x3] = meshgrid([0 1],[0 1],[0 1]); A ...

3 meses ago | 2

| accepted

Answered
複数の比較対象に関してどのインデックスが一致しているかを知る方法
ismember 関数を使うと、簡単に見つけることができます。たとえばご質問の例ですと、以下のようになります。 A = 11:20; B = [11 12 14 14]; [~,loc] = ismember(B,A); >> loc loc =...

3 meses ago | 2

| accepted

Answered
classify関数によって得られた確率をROC曲線の出力をすることは可能でしょうか?
classify 関数によって得られた確率(スコア)からROC曲線を出力をすることは可能です。そのためには、プログラムを若干修正する必要があります。 まず、perfcurve 関数への入力は、エラーメッセージにもあるように「スコアは浮動小数点のベクトルと...

3 meses ago | 4

| accepted

Answered
How to subset a table and pass the variable names?
Instead of using T2 = T{Ind,:} (I believe TT{Ind,:} is typo and T{Ind,:} is correct), the following can extract the correspondin...

3 meses ago | 0

| accepted

Answered
Change text to numbers in a cell
How about the following? B = replace(A,'text one','1'); B = cellfun(@str2double,B(:,1:end-1),'UniformOutput',false); A = [B,A...

3 meses ago | 1

| accepted

Answered
How can ı creat poisson random variables?
You can generate random number by using poissonrnd function, like; lambda = 75; r = poissrnd(lambda); Or, if you want to gene...

3 meses ago | 0

| accepted

Answered
How calculate daily, monthly, seasonally mean average and std?
I would recommend storing the data as timetable variable, and applying retime function. The following is an example: % Load da...

3 meses ago | 0

| accepted

Answered
Monthly Average from Daily Data
Another way is to use groupsummary function. The following is an example (note that the follwing returns average value with nan...

3 meses ago | 0

Load more