フィルターのクリア

Identifying Maximum, Minimum, and Average Values from CSV

4 ビュー (過去 30 日間)
Michael
Michael 2015 年 3 月 30 日
コメント済み: Image Analyst 2015 年 3 月 30 日
I have a series of CSV files, comprising of 10 seconds of data taken at 20Hz of an inconsistently oscillating electromagnet - with clipping in some of the data sets. I need to identify the maximum and minimum values, as well as the two mean values (one positive, the other negative), and I need the values to display in a plot of the data.
I've worked with CSVs in matlab before, and I've done min/max matlab before, but I am having trouble getting some of the peaks to associate properly (where there is clipping), and can't figure out how to get the values of the peaks to be labeled in plots. Nor have I had much luck in getting averages for values above zero, and values below zero to be displayed (I'm picturing a horizontal line - but a simple readout in a legend, or similar, would also work)
%%Outter Diameter 1%%
Array = csvread('ULPR_Magnet-OD_Strength.csv');
time = Array(:, 1);
mT = Array(:, 2);
[Maxima,MaxIdx] = findpeaks(mT, 'MinPeakDistance', 163);
figure
plot(time, mT, time(MaxIdx),Maxima,'or')
title('Toroidal Testing Magnet - Outside Diameter Field Strength')
xlabel('Time (s)')
ylabel('Magnetic Field (mT)')
  1 件のコメント
Image Analyst
Image Analyst 2015 年 3 月 30 日
You forgot to attach ULPR_Magnet-OD_Strength.csv.

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by