I have an 1x3 cell array:
Sequence =
{'3'} {'1'} {'4'}
and a global parameter (integer) named 'handles.times'.
Now I want to realize the following task:
If this integer is 2, then I get the following 'newSequence':
newSequence =
{'3'} {'1'} {'4'} {'3'} {'1'} {'4'}
If this integer is 3, then I get the following 'newSequence':
newSequence =
{'3'} {'1'} {'4'} {'3'} {'1'} {'4'} {'3'} {'1'} {'4'}
and so on...
Does someone know the method? Many thanks!

 채택된 답변

Scott MacKenzie
Scott MacKenzie 2021년 6월 19일

0 개 추천

n = handles.times; % your integer value
newSequence = repmat(sequence, 1, n);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2020a

태그

질문:

2021년 6월 19일

답변:

2021년 6월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by