⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 int_plotoptimal.m

📁 approximate reinforcement learning
💻 M
字号:
% Script to plot optimal Q-function and policy of simple integratorload int_optimal theta X U DIMSsavepath = 'd:\Work\tex\presentations\2007-03_benelux-07\img\int_optimal';figh = figure('Position', [0 0 700 300]);movegui(figh, 'center');% Compute policy curve[Qstar ui] = max(theta, [], 2);ui = lin2ndi(ui, DIMS.dimu);hstar = U{1}(ui);% Left: approximate Q-functionsubplot(121);ALPHA = 1;mesh(X{1}, U{1}, theta', 'EdgeAlpha', ALPHA, 'FaceAlpha', ALPHA); hold on;xlabel('x');ylabel('u');zlabel('Q*(x, u); h*(x)');plot3(X{1}, hstar, Qstar+.1, 'k', 'LineWidth', 2);plot3(X{1}, hstar, 0*hstar - 10, 'k', 'LineWidth', 2);subplot(122);plot(X{1}, hstar, 'k', 'LineWidth', 2);xlabel('x'); ylabel('h*(x)');saveas(figh, [savepath '.fig'], 'fig');% saveas(figh, [savepath '.eps'], 'psc2');saveas(figh, [savepath '.png'], 'png');pause;close(figh);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -