【App designer】測定データの該当区間のみグラフ化するアプリ
Afficher commentaires plus anciens
下記のアプリを検討しています。
①ファイル(添付画像)を読み込み
②該当箇所を判定(画像でいう赤枠箇所)
③最初の区間の範囲(画像でいう2~5行目)でのみグラフを作成

df = diff(app.data(:, 1));
idx = find(df >= 1, inf, 'first');
rows = zeros(1, numel(idx));
pos = 1;
for n = 1:numel(idx)
checkFlag = find(app.data(idx(n):end, 2) >= 1, 1, 'first');
if ~isempty(checkFlag) && (idx(n) > pos)
rows(1, n) = checkFlag;
pos = idx(n) + checkFlag - 1;
end
end
なお、グラフの作成は赤枠内のデータをY軸とし、X軸はこのY軸をもとに作成したいと考えています。
下記のようなイメージです。
また、以前同様の質問をしまして、下記のような回答をいただいています。
Y1 = [0 1 1 1 ]; %最初の該当区間となるデータを読み込み
Y2 = [0 0 0 1 ];
X = [0 0 0 1 ]; %該当区間のはじめを基準に幅2となるX軸データを作成
plot(app.UIAxes,x,y1,y2);
上記③の方法について、ご教授いただけますと幸いです。
よろしくお願いいたします。
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Simulink dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!