Community Profile

Akira Agata

MathWorks

Last seen: 3 days ago Active since 2016

All

Content Feed

View by

using a matrix in a calculation
To do an element-wise calculation of an equation to a matrix, you should add dot (.) just before operator, like: vr = (v0*r)./(...

28 days ago | 1

Find only interior points from set of points
As an another possible solution, how about using boundary function to detect exterior points? The following is an example: % S...

1 month ago | 1

pulse with modulation
If you have the Communications Toolbox, how about using commsrc.pattern ?

1 month ago | 0

1 month ago | 1

Finding indices of certain numbers from simulation data
How about using ismembertol function? The following is an example: x = [1, 1/3, 3/4, 4/5, 1, 1.1]; idx = ismembertol(x, 0.33,...

3 months ago | 0

3 months ago | 0

| accepted

rename files in a folder
How about the following solution? % Create list of all files in the current folder s = dir(pwd); s = struct2table(s); % Ex...

3 months ago | 1

| accepted

Help on creating a new column and fill values at specific locations
How about the following? % Example v1 = 1:4; v2 = [3, 6, 8, 10]; v3 = 1:10; % Create the new vector newVec = zeros(size(...

3 months ago | 0

| accepted

how to remove the cracks on image?
How about using inpaintCoherent or inpaintExemplar function?

4 months ago | 0

Marker on contourf plot
Please use (x,y) coordinate for plotting markers. The following is an example: load('Test.mat'); % Find (x,y) coordinate of...

5 months ago | 1

Create logarithmically spaced vector with points spaced more closely at far end of vector
Like this? % Normal log-spaced vector x1 = logspace(1, 2, 10); % Create inverse log space delta = diff(x1); delta = flipl...

6 months ago | 1

| accepted

How can I change the Nan values in a matrix by the values in cells array?
If you want to replace NaN by the given value in linear index order, the following will be one possible solution: % Given matri...

7 months ago | 1

コメントありがとうございます。 方眼幅のピクセル数を自動的に算出したいとのことですが、以下の方法はいかがでしょうか？ ちなみに、今回のケースは方眼が白色の線ですので平均輝度値のピークを検出していますが、黒線の場合には平均輝度値に -1 を乗算してピーク...

7 months ago | 2

| accepted

バイナリ画像における水平方向の白領域の広がりを測定したいです。
regionprops で重心を計算する際に、あわせて Bounding Box を計算しておいて、そのボックスの幅を「体領域における水平方向の幅」と見なせないでしょうか？ % 重心の描写 % s = regionprops(binary1,'cent...

7 months ago | 2

| accepted

8 months ago | 1

| accepted

How to obtain the outermost elements of a 2D matrix ?
How about the following? % Sample matrix M = magic(5); % Replace non-outermost element as NaN M(2:end-1, 2:end-1) = nan; ...

8 months ago | 2

| accepted

Rawデータをjpgに変換したいです

8 months ago | 1

| accepted

8 months ago | 1

| accepted

エラーバーを任意の点だけ表示する方法はありませんか
plot と errorbar を同じ色で重ねて表示する方法はいかがでしょうか？ たとえば 25個の (x,y) データがあり、5, 10, 15, 20番目のデータのみにエラーバーを表示したいとすると、以下のようになります。 % データ x = 1...

8 months ago | 0

| accepted

saving 3 dimensional data in excel file in a particular format
How about the following? for kk = 1:5 writematrix(squeeze(A(kk,:,:)), "yourExcel.xlsx", "Sheet", kk); end

8 months ago | 1

| accepted

x, yの実験データに対し、x,yを両辺に複数もつ複雑な理論式（x,yを変数とし、未知の係数を含む関数）によってフィッティングする方法を教えてください。
いくつかやり方がありますが、たとえば (x, y) の全データに対する左辺と右辺の差の二乗和を「 (a, b) を入力変数とする関数」として定義して、fminsearch で (a, b) の最適値を求めるというのはいかがでしょうか？

9 months ago | 0

Using load for different files with varying names
How about the following? for kk = 1:25 fileName = sprintf('data%d.mat', kk); load(fileName) % % Some proce...

9 months ago | 1

| accepted

いろいろなやり方があると思いますが、たとえばMATLABの基本関数のみを使う以下の方法はいかがでしょうか？ % 初期配列 J = repmat(6.5, 710, 710); % 中心 (335, 335), 半径 135 の円内のグリッド点を示...

9 months ago | 3

| accepted

Find value based on adjacent value condition and insert into new variable
ismember function will be helpful for this task, like: % Sample matrix A = [(0:50)', rand(51,1)]; % Second matrix with inde...

9 months ago | 1

| accepted

Rename a lot of files
How about the following? fileList = dir('*.csv'); for kk = 1:numel(fileList) fileNum = extractBetween(fileList(kk).name,'...

10 months ago | 1

Trying to plot a temperature distribution and generate a temperature contourn!
How about the following? L = 1; W = 1; [xGrid, yGrid] = meshgrid(0:0.025:1, 0:0.025:1); T = zeros(size(xGrid)); for n =...

10 months ago | 2

| accepted

How to find the midpoint between two curves in an image

10 months ago | 1

| accepted

I need to repeat numbers in an array with a certain number of repetitions for each value without(repelem or repmat)
I'm not sure why you do not prefer repelem/repmat... Anyway, how about the following solution? % Example list_1 = [2;3;5;6]; ...

10 months ago | 2

| accepted

Trouble using split function in matlab
How about the following? % Example dates = {'3/11/9102'; '3/12/9102'; '3/13/9102'; '3/14/9102'; '3/15/9102'}; % Split by '/...

10 months ago | 2

| accepted