How to downsample a vector x by an integer factor M with a single statement such as for loop or conditional statements

1 次查看(过去 30 天)
I have already learned to use downsample()function. However, are there ways to use statements to downsample a vector?

采纳的回答

Chunru
Chunru 2021-9-16
a = 1:10;
b = downsample(a, 3) % use downsample
b = 1×4
1 4 7 10
c = a(1:3:end) % statement
c = 1×4
1 4 7 10
  3 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by