I have to create discrete matrix
A(:,:,k) = [a b c d e f g h i j k l m n o p];
for k= 1:N
i want to allocate a b c... from matrix [0 10 20 30 40] only. How can i allocate randomly a b c...
please help me

 採用された回答

Guillaume
Guillaume 2015 年 12 月 17 日

0 投票

I'm not entirely clear on what you're asking. This may do what you want:
valuepool = [0 10 20 30 40];
N = 2;
randidx = randi(numel(valuepool), [16 16 N]);
A = valuepool(randidx)

1 件のコメント

Triveni
Triveni 2015 年 12 月 17 日
Sorry .....very sorry

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2015 年 12 月 17 日

コメント済み:

2015 年 12 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by