Matlab的R2014b存储其最近的文件中:
%APPDATA%\MathWorks\MATLAB\R2014b\MATLAB_Editor_State.xml
这是一个.xml文件,所以很容易加载和与xmlread解析。我不是很熟悉XML解析语法,但这里是如何获取有关文件(必须适应你的课程的需求)的信息:
function [recentFiles] = GetRecentFiles()
%[
% Opens editor's state file
filepart = sprintf('MathWorks\\MATLAB\\R%s\\%s', version('-release'), 'MATLAB_Editor_State.xml');
filename = fullfile(getenv('APPDATA'), filepart);
document = xmlread(filename);
% Get information about 'File' nodes
recentFiles = struct([]);
fileNodes = document.getElementsByTagName('File');
for fni = 1:(fileNodes.getLength())
attributes = fileNodes.item(fni-1).getAttributes(); % Careful, zero based indexing !
for ai = 1:(attributes.getLength())
% Get node attribute
name &