Answered
ファブリペロー干渉計について
初期パラメータを以下のように想定して計算したところ、波長によっては透過率(=出力光電力/入力光電力)が 1 を超えるという結果になっています。記載頂いた式のどこかに誤りがあると思われますので、再度ご確認頂けないでしょうか。 % 設定パラメータ Rx =...

2 maanden ago | 3

| accepted

Answered
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...

2 maanden ago | 1

| accepted

Answered
Simplifying an array with repeat values in it
How about the following? load('data.mat'); [g,tbl] = findgroups(data(:,{'partnumber','description'})); QYT = splitapply(@sum,...

2 maanden ago | 0

Answered
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.

2 maanden ago | 0

| accepted

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

2 maanden ago | 0

| accepted

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

3 maanden ago | 0

Answered
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(...

3 maanden ago | 0

Answered
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...

3 maanden ago | 0

| accepted

Answered
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...

3 maanden ago | 1

| accepted

Answered
特定の文字を抽出してプログラムを制御する方法と、テーブルに複数の単語を格納する方法についてご教授お願いいたします。
前回に引き続き、ちょっと面白そうなので少し考えてみました。 ざっと以下のようなプログラムになるかと思います。 ご質問の2点については、コメント欄に「★」をつけた部分になります。参考になれば幸いです。 % テーブルd(ictionary)の作成 T_...

3 maanden ago | 1

| accepted

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

3 maanden ago | 1

| accepted

Answered
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...

3 maanden ago | 1

| accepted

Answered
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...

3 maanden ago | 0

Answered
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 =...

3 maanden ago | 0

Answered
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 = [... ...

3 maanden ago | 1

| accepted

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

3 maanden ago | 3

| accepted

Answered
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...

3 maanden ago | 0

Answered
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(...

3 maanden ago | 0

| accepted

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

3 maanden ago | 0

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

3 maanden ago | 0

Answered
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...

3 maanden ago | 0

Answered
How to draw the tangent to a curve passing through the origin
Assuming that you want to obtain tangent lines which pass through the (-110,0), how about the following? In this code, I change...

3 maanden ago | 0

| accepted

Answered
How to generate a matrix of variables with continous values?
How about using reshape function? The following is an example: x = 1:100; P = reshape(x,10,10)';

3 maanden ago | 0

Answered
how to put border on the image over top and bottom
Assuming "imagea.jpg" and "imageb.jpg" have the same size, how about the following? a = imread('imagea.jpg'); b = imread('ima...

3 maanden ago | 0

Answered
How can I make diamond shape with a matrix?
How about the following? N = 5; % <- Should be odd number A = repmat([1 2;3 4],N); se = strel('diamond',floor(N/2)); idx = i...

3 maanden ago | 0

Answered
AlexNet、層の深さ
厳密には、どの層の数をカウントするかによって変わってきますが、「AlexNet:8層、GoogleNet:22層」といわれるときには「畳み込み層」と「全結合層」の合計数を指しています。 AlexNet:畳み込み層×5+全結合層×3=8層 GoogL...

3 maanden ago | 3

| accepted

Answered
複数のファイル読み込み
あるいは、ファイルが大量にあるようでしたら以下の方法ではいかがでしょうか。 % カレントフォルダにある .tifファイル一覧を作成 s = dir('*.tif'); s = struct2table(s); % 末尾が _2.tif ~ _4...

3 maanden ago | 2

| accepted

Answered
The splitting text contains file into separate columns
How about the following? % Read txt file fid = fopen('data1.txt','r'); strData = textscan(fid,'%s','Delimiter','\r\n'); strD...

3 maanden ago | 1

| accepted

Answered
How do I create a 3 dimensional response surface plot from X Y Z points ?
How about using an interpolation? The following is a simple example: % Apply cubic interpolation [xGrid,yGrid] = meshgrid(lin...

3 maanden ago | 0

| accepted

Answered
Create a cumulative sum under certain conditions
How about the following? % Sample data days = repelem((1:10)',10,1); names = repmat(['A':'J']',10,1); output = randi(100,100...

3 maanden ago | 0

Load more