# for generation of 10 i nput in each sequence for a sinusoidal signal

1 view (last 30 days)
Richa on 21 May 2023
Answered: VBBV on 21 May 2023
for k=4:1000
x(k) = 1.05 * sin(pi*k/45);
x(k-3:k+10-4)
end
In the above question, if I want to generate a input sequence in a batch of 10 for each iteration . Then how can we implement it?
##### 0 CommentsShow -1 older commentsHide -1 older comments

Sign in to comment.

### Answers (1)

VBBV on 21 May 2023
clearvars
% size or range of iteration
k = 4:1000;
x = 1.05 * sin(pi*k/45)
x = 1×997
0.2894 0.3591 0.4271 0.4929 0.5564 0.6172 0.6749 0.7294 0.7803 0.8274 0.8705 0.9093 0.9437 0.9735 0.9986 1.0188 1.0340 1.0442 1.0494 1.0494 1.0442 1.0340 1.0188 0.9986 0.9735 0.9437 0.9093 0.8705 0.8274 0.7803
for J = 1:length(k)-9
X(J,:) = x(J:J+9);
end
% batch of 10 inputs per iteration
X
X = 988×10
0.2894 0.3591 0.4271 0.4929 0.5564 0.6172 0.6749 0.7294 0.7803 0.8274 0.3591 0.4271 0.4929 0.5564 0.6172 0.6749 0.7294 0.7803 0.8274 0.8705 0.4271 0.4929 0.5564 0.6172 0.6749 0.7294 0.7803 0.8274 0.8705 0.9093 0.4929 0.5564 0.6172 0.6749 0.7294 0.7803 0.8274 0.8705 0.9093 0.9437 0.5564 0.6172 0.6749 0.7294 0.7803 0.8274 0.8705 0.9093 0.9437 0.9735 0.6172 0.6749 0.7294 0.7803 0.8274 0.8705 0.9093 0.9437 0.9735 0.9986 0.6749 0.7294 0.7803 0.8274 0.8705 0.9093 0.9437 0.9735 0.9986 1.0188 0.7294 0.7803 0.8274 0.8705 0.9093 0.9437 0.9735 0.9986 1.0188 1.0340 0.7803 0.8274 0.8705 0.9093 0.9437 0.9735 0.9986 1.0188 1.0340 1.0442 0.8274 0.8705 0.9093 0.9437 0.9735 0.9986 1.0188 1.0340 1.0442 1.0494
##### 0 CommentsShow -1 older commentsHide -1 older comments

Sign in to comment.

### Categories

Find more on Waveform Generation in Help Center and File Exchange

R2020a

### Community Treasure Hunt

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

Start Hunting!