필터 지우기
필터 지우기

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)')

답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by