MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   MATLAB在之间插入值 (https://www.labfans.com/bbs/showthread.php?t=26664)

poster 2019-12-14 20:46

MATLAB在之间插入值
 
在MATLAB中,我希望在向量的每个元素之间插入一个中间值

例如

v=[1,3,5,7,9] 我想得到

v=[1,2,3,4,5,6,7,8,9] 有快速的方法吗?



[B]回答:[/B]

a = [1 3 5 7 9]; b = [2 4 6 8]; c = zeros(9,1); c(1:2:9) = a; c(2:2:8) = b;

[url=https://stackoverflow.com/questions/5365096]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:28

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.