multiple vectors interpolation?

26 ビュー (過去 30 日間)
Davide Cerra
Davide Cerra 2018 年 12 月 13 日
回答済み: Star Strider 2018 年 12 月 13 日
hello,
i have 4 vectors and i want to fit all of them, how can i do it? simple example?
Untitled.png

回答 (1 件)

Star Strider
Star Strider 2018 年 12 月 13 日
To interpoolate a matrix of row vectors, something like this will work:
Vectors = rand(4, 10); % Concatenated Into Matrix Of 4 Rows, 10 Columns
Toriginal = 1:10; % Original Independent Variable Vector
newT = linspace(min(Toriginal), max(Toriginal), 25); % Independent Variable To Interpolate
newVectors = interp1(Toriginal', Vectors', newT, 'linear', 'extrap')'; % Interpolated Vectors
The original row vectors must be transposed to column vectors for the interp1 (link) function. This transposes them, does the interpolation, and then transposes them back to row vectors. If they are already column vectors, the transpositions are not necessary.

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by