Beantwortet
変数の凡例の付け方
ご質問の文面より、1つの図 (figure) 内に10個のデータをプロットするとともに凡例もあわせて表示したいと理解しました(間違っていたらご指摘ください)。その場合、以下のようにすれば良いかと思います。 figure hold on for j=1...

etwa 4 Jahre vor | 0

Beantwortet
forを使って測定した情報すべてを纏めるにはどのようにすればいいでしょうか?
とくに for ループを使う必要がなければ、filter2 関数で同じことが可能です。以下は簡単なサンプルコードです。 I = imread('image.jpeg'); %画像読み込み BW = imbinarize(rgb2gray(I)); %2...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
塗りつぶしの円を描くにはどうすればよいのでしょうか
rectangle 関数の Curvature プロパティを [1 1] に設定する方法で円を描画するのはいかがでしょうか? colors = {'b','r','g','y','k'}; X = rand(5,1); Y = rand(5,1)...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to count the amount of excell row
How about using accumarray function? The following is an example: % Sample data (column vector containing 1~10 randomly) data ...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
Excelから読み込んだ値を、規則的に順番に足し合わせるにはどうすればよいでしょうか。
movsum 関数を使うと、移動合計値を簡単に算出することができます。以下はその一例です。 % Sample data data = rand(100,1); % Apply movsum dataSum = movsum(data,5,'En...

mehr als 4 Jahre vor | 0

Beantwortet
行列から条件を指定して値を取り出す
もし、行列Aの2行目の要素で 1 (or 0) が偶数個連続している部分があり、かつ要素が 1 (or 0) の列のうち 2k 番目と 2k-1番目との差を取りたいということであれば、以下の方法で計算可能です。 A = [ 0 1 2 4 3 6 4 8...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
xlsreadをreadcellに置き換え時の空白データの処理
1行目に変数名、2行目以降にデータが入っているということであれば、readtable 関数が適しているかと思います。もし変数名が日本語などの場合は、以下のように 'PreserveVariableNames' オプションを true に設定することでうまく...

mehr als 4 Jahre vor | 0

Beantwortet
行列から条件を指定して値を取り出す
以下のような方法はいかがでしょうか? A = [1 2 3 4 5 6 7; 0 1 1 0 1 1 0]; idx = [0 diff(A(2,:))] == 1; B = A(1,idx); 結果: >> B B = 2 ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
using readtable to convert columns containing dates to datetime
Like this? T = readtable('US_Presidents.xlsx','PreserveVariableNames',true); T.("Birth Date") = datetime(T.("Birth Date")); T...

mehr als 4 Jahre vor | 0

Beantwortet
Combining and sorting two meshgrids
How about the following? Xall = [X1(:); X2(:); X3(:); X4(:)]; Yall = [Y1(:); Y2(:); Y3(:); Y4(:)]; vall = [v1(:); v2(:); v3(:...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
cell array with numeric values only
Another possible solution: C = {'long: 151.125#';'long: 151.126#'}; V = regexp(C,'[?\d.]+','match','once'); V = str2double(V)...

mehr als 4 Jahre vor | 0

Beantwortet
How to plot 4 different backgrounds in a figure?
How about using uipanel? The following is an example: % Sample colormap cMap = rand(4,3); % Graphic object array hPanel =...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Determine the intensity value, "T", in a 2D image for which 99.9% of all intensity values are less than "T"
I believe prctile function will be helpful to this task, like: % Read sample gray scale image I = imread('cameraman.tif'); ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Series of rectangular pulses with increasing pulse length
How about using modulate function (Signal Processing Toolbox)? The following is an example: fs = 100; fc = 5; data = 0:0.2:1...

mehr als 4 Jahre vor | 0

Beantwortet
all possible combination between matrices
Seems to be an interesting 'puzzle'. Though this is not so smart, how about the following? %% Data A = {[2,1],[0,6],[4,2]}; ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
excelデータのインポートに関して
以下の方法ではいかがでしょうか? A = readmatrix('sample.xlsx'); C = mat2cell(A,ones(1,size(A,1))); >> C C = 4×1 の cell 配列 {1×5 d...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
Contour plots with irregular grids
How about the following? % Read data file tData = readtable('data.xlsx'); tData.Properties.VariableNames = {'x','y','TEMP'}; ...

mehr als 4 Jahre vor | 4

| akzeptiert

Beantwortet
原点と座標から角度
後半のご質問は、atan2d 関数を使うことで解決できます。ただし -180 ~ +180 度の値を返すので、これを 0 ~ 360 度に変換する必要があります。たとえば以下のようなやり方はいかがでしょうか? % 例として、x軸とベクトル (x,y) =...

mehr als 4 Jahre vor | 0

Beantwortet
行列の重複している行を削除する方法
unique 関数の順序フラグを 'stable' に指定することで実現可能かと思います。 A = [1, 0, 1, 1, 1 ; 0, 1, 1, 0, 0 ; 0, 0, 0, 1, 1 ; 1, 0, 1, 1, 1 ; 1, 1, 0, 1, ...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
Color map from green to red
You can create your original colormap (green to red) and apply to the data. The following is an example: % Create green-to-red...

mehr als 4 Jahre vor | 2

| akzeptiert

Beantwortet
Sum elements of corresponding equal elements
How about the following solution? % Create sample 36-by-3 array C rng('default'); % for reproducab...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Select values from martix with an absolute value and set them to zero.
Like this? A = randi([-10 10],6); % 6x6 matrix (ranging from [-10,10]) idx = abs(A) == 5; % Find elements whose absolute...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
極座標のヒストグラムを作製
polarhistogram 関数を使うと極座標でのヒストグラムを作成できます。 たとえば8等分した角度ごとの測定値をプロットする場合、以下のようになるかと思います。 % 8等分した角度(theta)と測定値(val)の模擬データ theta = 0...

mehr als 4 Jahre vor | 1

Beantwortet
配列の各要素を別の配列の変数として定義したい.
詳細な説明、ありがとうございます。 それでは、以下のような方法ではいかがでしょうか? A = [1 0.1 0.01]; B = zeros(1,4); % ベクトルBを初期値0で作成 n = numel(A); % ベクト...

mehr als 4 Jahre vor | 0

Beantwortet
MATLABでファイルのサイズを取得したい
dir 関数が使えるかと思います。 たとえば以下のようにすると、data.xlsのファイルサイズ [bytes] が変数 t_fileSize に格納されます。 s = dir('data.xls'); t_fileSize = s.bytes;

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
2次元上で楕円を描くにはどのようにしたらよいでしょうか。
いろいろなやり方がありますが、たとえば陰関数をプロットする fimplicit 関数を使う方法はいかがでしょうか? 一例として、楕円をあらわす方程式 (x/a)^2 + (y/b)^2 = 1 を a=5, b=2 としてプロットすると以下のようになりま...

mehr als 4 Jahre vor | 0

Beantwortet
グレースケール化のエラー
おそらく、もとの画像ファイルがインデックス付き画像ファイルになっていることが原因と思われます。 その場合、以下のようにいったん通常のRGB画像に変換したうえでグレースケール化すれば大丈夫です。 [IDX, cmap] = imread('2007_00...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
correlation of signals and finding time delays
If you have Signal Processing Toolbox, please try finddelay function.

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
角度の求め方
アークコサイン(逆余弦関数)を使って求めることができます。MATLABの関数としては、acos 又は acosd になります。出力される角度θを、前者はラジアン、後者は度として出力します。 % 例: cos(θ) = 0.5 のθを求める theta_...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
重複したデータを削除する方法
findgroups と splitapply を使う方法はいかがでしょうか? A = [600 142 30 75 13; 600 141 30 75 14; 600 142 30 80 14]; group = findgroups(A(:,4))...

mehr als 4 Jahre vor | 1

| akzeptiert

Mehr laden