フィルターのクリア

How can I plot average loop graph as given in the image

4 ビュー (過去 30 日間)
Manav Divekar
Manav Divekar 2021 年 10 月 23 日
コメント済み: Manav Divekar 2021 年 10 月 23 日
clc
clear all
close all
C = readtable('A_G1.txt', 'NumHeaderLines',8);
%Convert to SI Units
accG2test = C{:,1}.*9.81;
forceG2test = C{:,2}.*0.00981;
dispG2test = C{:,3}./1000;
dispG2test2 = smoothdata(dispG2test, 'sgolay', 100);
%force
forceG2test2 = smoothdata(forceG2test, 'sgolay', 100);
z = linspace(min(dispG2test2),max(dispG2test2),length(dispG2test2));
[cmin,cxix] = (min(dispG2test2));
[cmax,cnix] = (max(dispG2test2));
[fmin,fxix] = (min(forceG2test2));
[fmax,fnix] = (max(forceG2test2));
%meana = mean(dispG2test2,3);
%meanb = mean(forceG2test2,2);
%xx = spline(meana,meanb);
figure(1)
plot(dispG2test2, forceG2test2)
hold on
plot([cmin cmax], [fmin fmax], '+r', 'MarkerSize', 5, 'LineWidth',1.5)
%plot (xx,'or')
hold off
legend('Force v. Deflection');
title('Force vs Deflection');
xlabel('Deflection[m]');
ylabel('Force[N]');

回答 (1 件)

Image Analyst
Image Analyst 2021 年 10 月 23 日
I'd start by looking at splitapply(), grpstats(), or groupsummary() to get the average of each unique pair of (x,y) coordinates.
  5 件のコメント
Image Analyst
Image Analyst 2021 年 10 月 23 日
編集済み: Image Analyst 2021 年 10 月 23 日
If you're going to cross verify (compare mine to yours) then that means you already have your own version already. Tell me your way first.
Manav Divekar
Manav Divekar 2021 年 10 月 23 日
yes i tried using the mean as I have commented in the code. But it didn't work so i was trying but i am not able to do it. So was asking for your help.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLarge Files and Big Data についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by