Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab插值切换因变量_Matlab_Interpolation - Fatal编程技术网

Matlab插值切换因变量

Matlab插值切换因变量,matlab,interpolation,Matlab,Interpolation,我有一个Nx2矩阵,列为“时间”和“进度” 进度是整数,时间是对应于每个进度单位的实际值 我想反转依赖关系,使“时间”成为整数,并在每个单位时间步输出分数“进度” 如何做到这一点?使用interp1(进度、时间、所需时间)其中所需时间是一个包含所需时间的新向量。例如: Progress=1:10; %just a guess of the sort of progress you might have Time=Progress*5.5; %the resulting times

我有一个Nx2矩阵,列为“时间”和“进度”

进度是整数,时间是对应于每个进度单位的实际值

我想反转依赖关系,使“时间”成为整数,并在每个单位时间步输出分数“进度”

如何做到这一点?

使用
interp1(进度、时间、所需时间)
其中
所需时间是一个包含所需时间的新向量。例如:

Progress=1:10;       %just a guess of the sort of progress you might have
Time=Progress*5.5;   %the resulting times (say 5.5s per step)
TimesWanted=10:5:50; %the times we want
interp1(Time,Progress,TimesWanted)
给我:

ans =
1.8182    2.7273    3.6364    4.5455    5.4545    6.3636    7.2727    8.1818    9.0909
这是通过插值获得的
所需时间的进度。

使用
interp1(进度、时间、所需时间)
其中
所需时间
是包含所需时间的新向量。例如:

Progress=1:10;       %just a guess of the sort of progress you might have
Time=Progress*5.5;   %the resulting times (say 5.5s per step)
TimesWanted=10:5:50; %the times we want
interp1(Time,Progress,TimesWanted)
给我:

ans =
1.8182    2.7273    3.6364    4.5455    5.4545    6.3636    7.2727    8.1818    9.0909
这是通过插值获得的
所需时间的进度