Main Content

listImpactedFiles

指定したプロジェクト ファイルへの変更によって影響を受けるファイルの取得

R2021a 以降

説明

impactedfiles = listImpactedFiles(proj,files) は、実行するために、指定した files を必要とするプロジェクト ファイルの名前を返します。

すべて折りたたむ

プロジェクト Times Table App を開きます。currentProject を使用してプロジェクト オブジェクトを作成します。

openExample("matlab/TimesTableProjectExample")
proj = currentProject;

timesTableGame.m に変更を加えます。

fid = fopen('source/timesTableGame.m','a');
fwrite(fid,'% Add simple comment');
fclose(fid)

変更済みファイルの影響を受けるファイルを取得します。

modifiedfiles = listModifiedFiles(proj);
impactedfiles = listImpactedFiles(proj,modifiedfiles)
impactedfiles = 

  6×1 string array

    "C:\workSpace\examples\TimesTableApp\requirements\TimesTableRequirements.mlx"
    "C:\workSpace\examples\TimesTableApp\source\timesTableGame.m"
    "C:\workSpace\examples\TimesTableApp\source\timestable.mlapp"
    "C:\workSpace\examples\TimesTableApp\tests\tAnswerIsCorrect.m"
    "C:\workSpace\examples\TimesTableApp\tests\tCurrentQuestion.m"
    "C:\workSpace\examples\TimesTableApp\tests\tNewTimesTable.m"

入力引数

すべて折りたたむ

プロジェクト。matlab.project.Project オブジェクトとして指定します。currentProject を使用して、現在読み込まれているプロジェクトからプロジェクト オブジェクトを作成します。

ファイル拡張子を含むプロジェクト ファイルのパス。文字ベクトルの cell 配列、string 配列、または ProjectFile オブジェクト配列として指定します。files をファイルの絶対パスまたはプロジェクトのルート フォルダーへの相対パスとして指定します。ファイルはプロジェクト ルート フォルダー内になければなりません。

出力引数

すべて折りたたむ

影響を受けるプロジェクト ファイル。string 配列として返されます。

バージョン履歴

R2021a で導入