资源简介
简单实用的matlab源码,描述了Q学习的过程,实现了探索和最优化。
代码片段和文件信息
function y=RandomPermutation(A)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% return random permutation of matrix A
% unlike randperm(n) that give permutation of integer 1:n only
% RandomPermutation rearrange member of matrix A randomly
% This function is useful for MonteCarlo Simulation
% Bootstrap sampling game etc.
%
% Copyright Kardi Teknomo(c) 2005
% (http://people.revoledu.com/kardi/)
%
% example: A = [ 2 1 5 3]
% RandomPermutation(A) may produce [ 1 5 3 2] or [ 5 3 2 3]
%
% example:
% A=magic(3)
% RandomPermutation(A)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[rc]=size(A);
b=reshape(Ar*c1); % convert to column vector
x=randperm(r*c); % make integer permutation of similar array as key
w=[bx‘]; % combine matrix and key
d=sortrows(w2); % sort according to key
y=reshape(d(:1)rc); % return back the matrix
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 929 2011-10-18 18:44 Q-learning\RandomPermutation.m
文件 2593 2011-10-18 18:44 Q-learning\ReinforcementLearning.m
目录 0 2011-10-18 18:45 Q-learning
----------- --------- ---------- ----- ----
3522 3
- 上一篇:波达方向估计MAtLAB
- 下一篇:基于nsct+pcnn的图像融合
评论
共有 条评论