How to modify vector length ??

조회 수: 1 (최근 30일)
Nicolò Monaco
Nicolò Monaco 2021년 3월 15일
댓글: Nicolò Monaco 2021년 3월 15일
I have a column vector with 604800 values representig power generation for a system per second in a week. On the other side I have another column vector of 10080 values that are the electrical load per minute in a week. I have to find the mismatch, so they must have the same lenght. The 10080 vector must be translated from "values per minute" to "values per second"
I thought interpolation can be a solution, but I cannot do it for every two subsequent values. Ideas??

채택된 답변

ANKUR KUMAR
ANKUR KUMAR 2021년 3월 15일
편집: ANKUR KUMAR 2021년 3월 15일
You can use interp1 to do that.
data1_per_second=randi(25,1,604800);
data2_per_minute=randi(25,1,10080);
data2_per_second=interp1([1:60:7*24*3600],data2_per_minute,[1:1:7*24*3600]);
  댓글 수: 1
Nicolò Monaco
Nicolò Monaco 2021년 3월 15일
Thank you, very useful!!!!!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by