addShortcut
ショートカットをプロジェクトに追加
説明
は、プロジェクト内の指定されたファイルへのショートカットを追加します。プロジェクトで、重要なファイルを開いたり、データを読み込むといった一般的なプロジェクト タスクを実行するためにショートカットを使用できます。shortcut
= addShortcut(proj
,file
)
起動時またはシャットダウン時に実行するようにショートカットを設定するには、起動ファイルとシャットダウン ファイルの指定を参照してください。
例
ショートカットの追加
プロジェクト Times Table App を開きます。currentProject
を使用して、現在読み込まれているプロジェクトからプロジェクト オブジェクトを作成します。
openExample("matlab/TimesTableProjectExample")
proj = currentProject;
新規ファイルを作成します。
filepath = fullfile(proj.RootFolder,"newvariables.mat");
save(filepath)
この新規ファイルをプロジェクトに追加します。
projectFile = addFile(proj,filepath)
新規ショートカットを新規ファイルに追加します。
shortcut = addShortcut(proj,filepath);
shortcut = Shortcut with properties: Name: "newvariables" Group: "General" File: "C:\myProjects\examples\TimesTableApp\newvariables.mat"
入力引数
proj
— プロジェクト
matlab.project.Project
オブジェクト
プロジェクト。matlab.project.Project
オブジェクトとして指定します。currentProject
を使用して、現在読み込まれているプロジェクトからプロジェクト オブジェクトを作成します。
file
— ファイルのパス
文字ベクトル | string スカラー
ファイル拡張子を含むショートカット ファイルのパス。文字ベクトルまたは string スカラーとして指定します。プロジェクトのルート フォルダーに対して相対的なパスを指定します。ファイルはプロジェクト ルート フォルダー内になければなりません。
出力引数
shortcut
— ショートカット
Shortcut
オブジェクト
ショートカットに関する情報を含む Shortcut
オブジェクト。
バージョン履歴
R2019a で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)