code for pseudo random index generator

2 次查看(过去 30 天)
in our project we have pseudo random index generator for generating set of keys with which we select some of the keys and encrypt the image.sir ,please can you provide the basic idea for us how to write the code for it?

采纳的回答

Jos (10584)
Jos (10584) 2014-1-23
You provide little information, but this might help:
AllKeys = [10 13 22 -9 0 12345]
N = 3 ; % randomly select N of these keys
IDX = randperm(numel(AllKeys), N)
KeysSelected = AllKeys(IDX)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by