How to fit data to another data

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일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2020년 4월 8일

답변:

2020년 4월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by