Where can I find a list of built-in example data?

8 ビュー (過去 30 日間)
Chad Greene
Chad Greene 2014 年 6 月 17 日
編集済み: Jason Nicholson 2014 年 6 月 18 日
When I come up with examples for functions that I write, the first several lines of my example files are often spent creating fake data. Example data like load train are quite helpful because they are built into Matlab, but I have not been able to find a clear list of what example data are available, and on what Matlab releases.
For my current task, I'd like to find a chart of example data associated with the Mapping Toolbox. Does this list exist somewhere?
  1 件のコメント
Geoff Hayes
Geoff Hayes 2014 年 6 月 17 日
I'm not sure that such a list for each toolbox exists. I noticed that the Statistics Toolbox mentioned some of the data sets that it includes ( http://www.mathworks.com/help/stats/_bq9uxn4.html) but I couldn't see anything for the Mapping Toolbox. You may have to do what Jason suggests below.

サインインしてコメントする。

回答 (2 件)

Jason Nicholson
Jason Nicholson 2014 年 6 月 17 日
編集済み: Jason Nicholson 2014 年 6 月 17 日
This will work:
pathFolderList = strsplit(path(),';');
matFilesOnPath = cell(size(pathFolderList));
matFileCount = 0;
for iFolder=1:length(pathFolderList)
matFilesOnPath{iFolder} = ls([pathFolderList{iFolder} filesep '*.mat']);
matFileCount = matFileCount + size(matFilesOnPath{iFolder},1);
end
I had 1,025 mat files on my path.
Bare in mind that you may have toolboxes other will not. If you stick to the folders contained as part of the core MATLAB functionality, you should be able to find data that everyone has if the versions are the same.
  3 件のコメント
Image Analyst
Image Analyst 2014 年 6 月 17 日
You can use allwords:
folderNamesList = allwords(someStringWithSemicolons,';');
Jason Nicholson
Jason Nicholson 2014 年 6 月 18 日
編集済み: Jason Nicholson 2014 年 6 月 18 日
Yes, strsplit is new. The copyright in the file says 2012.
You can also use
pathFolderList = regexp(path(), ';', 'split');
regexp has been around for a long time.

サインインしてコメントする。


the cyclist
the cyclist 2014 年 6 月 17 日
I don't know if this is a complete list, but here are some examples .

カテゴリ

Help Center および File ExchangeStandard File Formats についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by