0001 function h=plot(RM)
0002
0003
0004
0005
0006
0007
0008 if dim(RM.S)==1 && dim(RM.A)==1
0009
0010 s=min(RM.S):max(RM.S);
0011 a=min(RM.A):max(RM.A);
0012 ns=size(s,2);
0013 na=size(a,2);
0014 sr=zeros(ns,na);
0015 for i=1:ns
0016 for j=1:na
0017 sr(i,j)=sum(RM.w.*cellfun(@(g)(Value(g,s(i))),RM.gS).*cellfun(@(g)(Value(g,a(j))),RM.gA));
0018 end
0019 end
0020 h=surf(s,a,sr');
0021 else
0022 error('CS_CA_RewardModel plot only implemented for one-dimensional S/A spaces');
0023 end