check_data=test_data_in(1:600);
for i=1:600
check_data(i)=test_data_in(randi(numel(test_data_in)))
end

답변 (1개)

Jan
Jan 2021년 3월 10일
편집: Jan 2021년 3월 10일

0 개 추천

Your code runs without problems:
test_data_in = rand(1, 1000);
check_data = test_data_in(1:600);
for i = 1:600
check_data(i)=test_data_in(randi(numel(test_data_in)));
end
So what is your problem?
Does your test_data_in has less than 600 elements?

카테고리

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

질문:

2021년 3월 10일

편집:

Jan
2021년 3월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by