How to find average of two lines on a graph

2 ビュー (過去 30 日間)
Ross Hanna
Ross Hanna 2017 年 8 月 11 日
回答済み: Chad Greene 2017 年 8 月 12 日
Hi there.
I am doing some research into computing suspension characteristics of motorcycle suspension. We have used a suspension dynamometer (damper dyno) to record time, force, displacement and velocity. The damper dyno gives data in the form of a text file as attached below (Damper Dyno CR500 Shock.txt). I have copied this into excel and converted all the data into numbers that can be manipulated. I have plotted force vs displacement, force vs velocity and absolute force vs velocity. I have attached the excel file ( below so you can see what i'm talking about in this next bit. the force vs velocity graph loops back on itself and to get a useful graph you have to take the average of the two lines e.g at 200 m/s the force in the positive region is 300N and 600N. I need the average force so in that example 450N but for all the 4984 data points. I am on matlab answers because i think you will be able to help make it simpler using matlab rather than overtaxing matlab with a 5000x5000 table.
So my question is... for the graph on the sheet labelled 'F vs V (abs F), can you think of a way to average the data to give a graph like the picture i have added (Average Force vs Velocity.jpg) which is the same data just an average of the force to give a single line rather than the loop.
Many thanks
Ross
  1 件のコメント
Ross Hanna
Ross Hanna 2017 年 8 月 12 日
ok, second question which may simplify my reasoning for what i want to do.
x=Force %imported from excel as column vector y=Velocity %imported from excel as column vector plot(x,y)
now, i'm trying to average force, so, how could i write a code that if i give it a velocity of 400m/s, gives me the however many answers there is (say two for ease). this code partially does it but returns only one result.
%example X=Force; Y=Velocity; index=find(Y==400); X_point=X(index)
if this gave me the two results, i could then average them, repeat every however many times to do it for the whole graph. however, i would need to do the positive y values first, then the negative and average separately.
Thanks

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

回答 (1 件)

Chad Greene
Chad Greene 2017 年 8 月 12 日
Looks like a classic hysteresis loop. You could sort the data and take a moving average, or fit a curve, or use my scatstat1 function.

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by