Variable out_vec must be of size [1 3]. It is currently of size [1 20]. Check where the variable is assigned a value.

2 ビュー (過去 30 日間)
Raizel Lampert
Raizel Lampert 2021 年 7 月 27 日
コメント済み: KSSV 2021 年 7 月 27 日
How can I reduce [1 20] size to a [1 3] size, without getting in the problem of needing only the number 1 10 and 20 in a vector row?

回答 (1 件)

KSSV
KSSV 2021 年 7 月 27 日
x = 1:20 ;
idx = sort(randperm(length(x),3)) ; % select randomly
x(idx)
ans = 1×3
3 6 8

カテゴリ

Help Center および File ExchangeDebugging and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by