필터 지우기
필터 지우기

how to get absolute value ?

조회 수: 10 (최근 30일)
Aniket
Aniket 2013년 4월 11일
댓글: James 2013년 10월 31일
I have some error data with time. and i want to get minimum absolute value from one time point till end time point.
for example
time 0 1 2 3 4 5 6
data 0.3 0.4 0.5 0.6 0.8 0.9 1.0
in the above example i want to get minimum absolute value from time = 3 to time = 6
so should i get this ?
right now i am doing like this
y = min(abs(e(3,end)))
e is variable where i am saving this time and data

채택된 답변

Jan
Jan 2013년 4월 11일
time = [0 1 2 3 4 5 6]:
data = [0.3 0.4 0.5 0.6 0.8 0.9 1.0];
ini = find(time == 3);
fin = find(time == 6);
result = min(abs(data(ini:fin)));
  댓글 수: 2
Aniket
Aniket 2013년 4월 11일
for my simulation i amgetting data like this
e{1,1} first coloumn time points and second coloumn data for how should i write abs command ?
y1 = min(abs(e{1,1}(18077:end)))
18077 is row number.
James
James 2013년 10월 31일
Indexing a matrix is:
e(rows,columns)
so you want to use:
e(18077:end, 2)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by