Limiting vectors to a certain number of rows

Hi, i have created a function that creates n lots of a matrix of 3 columns but different number of rows. How do i limit the number of rows of this matrixes to say 4 for each one?

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2013년 12월 12일

0 개 추천

n = 7;
out = arrayfun(@(x)rand(randi(4),3),1:n,'un',0);

이 질문은 마감되었습니다.

태그

질문:

2013년 12월 12일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by