필터 지우기
필터 지우기

Normalize from -1 to 1... help me

조회 수: 1 (최근 30일)
Jeong_evolution
Jeong_evolution 2016년 11월 10일
댓글: Jeong_evolution 2016년 11월 10일
I have data like this ↓
temp Hum Atmosphere Wind.......
-10.2 50 101000 290 7.4 0 0 0
-11.5 47 101100 290 7 0 0 0
-12.5 44 101200 320 6.7 0 0 0
-13.1 43 101300 320 6.2 0 0 0
-13.3 43 101300 320 5.6 0 0 0
-13.5 43 101300 320 5.1 0 0 0
-13.1 44 101300 320 5.5 1 0 0
-12.9 44 101400 320 5.8 2 17 0.1
-12.7 44 101400 320 6.2 2 134 2.52
-12.9 41 101400 320 6.2 2 293 8.83
-13.1 39 101400 320 6.2 2 434 18.02
-13.3 37 101500 320 6.2 2 532 21.36
-13.9 34 101400 320 6.7 2 576 13.76
-14.5 32 101400 320 7.2 2 564 13.65
-15.1 29 101300 320 7.7 2 495 13.37
-14.9 31 101400 320 7.5 2 377 7.51
-14.7 34 101400 320 7.4 2 223 4.61
-14.5 36 101400 360 7.2 2 70 1.7
-14.5 37 101500 360 6.7 2 4 0.29
-14.5 39 101600 360 6.2 1 0 0
-14.5 40 101600 320 5.7 0 0 0
-14.5 40 101700 320 5.9 0 0 0
-14.5 40 101700 320 6 0 0 0
-14.5 40 101800 320 6.2 0 0 0
I wnat to normalize from -1 to 1.
I use the bsxfun, normalize, min, max ...
But I can't.. Please help.

채택된 답변

KSSV
KSSV 2016년 11월 10일
편집: KSSV 2016년 11월 10일
Let data be the column/row vector you want to normalize between -1 and 1.
clc; clear all ;
data = rand(100,1) ; % a random data
normalized_data = -1 + 2.*(data - min(data))./(max(data) - min(data));
  댓글 수: 1
Jeong_evolution
Jeong_evolution 2016년 11월 10일
Thank you for Ansewr So many help for me!

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

추가 답변 (1개)

Mostafa
Mostafa 2016년 11월 10일
%dataSet = your data
min_L = -1;
max_L = 1;
dataSet = dataSet/norm(dataSet, Inf); %Normalize between 0 and 1
dataSet = (dataSet*(max_L - min_L)) + min_L; %Normalize between min_L and max_L
  댓글 수: 1
Jeong_evolution
Jeong_evolution 2016년 11월 10일
Thanks. MS.(?)Mostafa !

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

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by