필터 지우기
필터 지우기

Interpulating multipule sets of data without loops

조회 수: 1 (최근 30일)
Ariel
Ariel 2023년 2월 8일
댓글: Fifteen12 2023년 2월 8일
Hello,
I am trying to do 1D interpulation on multipule sets of data without using loops.
If I must use a loop, the code would look as follows:
X ; % set of grid points, where each column is a different set
V ; % set of data points, where each column is a different set
xq ; % new grid points I would like to interpulate V at.
% Note that size(X) is the same as size(V) and they are both 2D
% All these values are defined priorly in the code.
Vq = zeros(length(xq),size(V,2)) ;
for i=1:size(X,2)
Vq(:,i) = interp1(X(:,i),V(:,i),xq);
end
Is there a way I can run a simular algorithem without running this loop?
Thank you in advance.
  댓글 수: 2
Fifteen12
Fifteen12 2023년 2월 8일
Can you explain what (size(X,1),1) means? Are you saying that xq has the same number of rows as X?
Fifteen12
Fifteen12 2023년 2월 8일
Maybe try splitapplly? Sorry I don't have time to run the code on this.

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

답변 (0개)

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by