How to fit data to another data

조회 수: 2 (최근 30일)
Alina Li
Alina Li 2020년 4월 8일
답변: Ameer Hamza 2020년 4월 8일
I have two 1000000x1 vectors of data (data1 and data2). data1 is normalized. Now I need to scale data2 to data1.
  댓글 수: 2
lazymatlab
lazymatlab 2020년 4월 8일
You need to be more specific. What do you mean by 'scale'? Do you want to multiply a scalar to data2? Or each element of data2 needs to scale individually?
Alina Li
Alina Li 2020년 4월 8일
This is a more of a general question. I want to scale each element of data2 to data1. So the size of plot of data1 (i.e. the values in vector of data1) is proportional to data2 vector/plot. I have a variety of different data I need to work with. So my question is not case specific.

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

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 4월 8일
You can try something like this
x % the normalized array
y % the unnormalized array
y_norm = normalize(y, 'range')*(max(x)-min(x))+min(x)
It will make the min() and max() values of x and y same.

카테고리

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by