Clicking on hyperlink for an "example" on MATLAB command line help changes my current directory
3 ビュー (過去 30 日間)
古いコメントを表示
This is not a question per se but a comment/complaint. Changing current directory is so disruptive. All I want to do is to just read the example. Anyone feel the same ?
0 件のコメント
回答 (1 件)
Steven Lord
2025 年 2 月 2 日
Do you want to read the example and potentially run some or all of it? I think that's a pretty common workflow for the examples. Examples may have helper files necessary to run them. Changing directory to the example's directory makes those helper files available to MATLAB.
We could stop changing directory, but then we'd have to tell you how and where you need to find those helper files when you tried to run a selection of the example. That could be very confusing and difficult (if you select a piece of the example in the Editor, copy it, and paste it into the Command Window, how would we necessarily know that the copied code originally came from an example and from which example it came?)
4 件のコメント
Walter Roberson
2025 年 2 月 2 日
Examples generally are composed of multiple files. Browsing the files together requires changing the directory -- or else having the editor open all of the relevant files at the time of opening the example (which has its own issues.)
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!