How to combine two outputs of a into a single vector.
조회 수: 5 (최근 30일)
이전 댓글 표시
L = randi([2,5]);
lo = [1,5,10]
hi = [3,8,9]
for k = 1:length(hi)
if hi(k(1:end))>lo(k(1:end))
a=[lo(k):hi(k)]
end
end
댓글 수: 0
채택된 답변
Star Strider
2020년 3월 11일
I am not certain what result you want.
Try this:
L = randi([2,5]);
lo = [1,5,10];
hi = [3,8,9];
for k = 1:length(hi)
if hi(k(1:end))>lo(k(1:end))
a{k}=[lo(k):hi(k)];
end
end
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!