1 Star 0 Fork 0

tianyu/DCT_threePoints

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
randinterval.m 673 Bytes
一键复制 编辑 原始数据 按行查看 历史
S_Braylon 提交于 2019-10-26 14:46 . DCT_threePoints
function [ row, col] = randinterval( matrix, count, key)
[ m, n] = size( matrix) ;
interval1 = floor( m* n /count) + 1;
interval2 = interval1 - 2;
if interval2 == 0 error( '载体太小不能将秘密信息隐藏进去! ') ;
end
rand('seed' , key) ;
a = rand( 1, count) ;
row = zeros( [ 1 count] ) ;
col = zeros( [ 1 count] ) ;
r = 1;
c =1;
row( 1, 1) = r;
col( 1, 1) = c;
for i = 2:count
if a( i) >=0.5
c = c + interval1;
else
c = c + interval2;
end
if c > n
r = r +1;
if r > m
error( '载体太小不能将秘密信息隐藏进去! ') ;
end
c = mod( c, n);
if c ==0
c = 1;
end
end
row( 1, i) = r;
col( 1, i) = c;
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Matlab
1
https://gitee.com/S_Braylon/DCT_threePoints.git
git@gitee.com:S_Braylon/DCT_threePoints.git
S_Braylon
DCT_threePoints
DCT_threePoints
master

搜索帮助