listStartupIssues - List all issues that occur when project opens - MATLAB (original) (raw)
Main Content
List all issues that occur when project opens
Since R2025a
Syntax
Description
[projectStartupIssues](#shtbu4j88b-01%5Fsep%5Fbu4j88b-modifiedfiles) = listStartupIssues([proj](#shtbu4j88b-01%5Fsep%5Fmw%5F56667886-df27-4faf-868a-62680206145f))
returns the list of issues that occur during the project proj
startup.
[projectStartupIssues](#shtbu4j88b-01%5Fsep%5Fbu4j88b-modifiedfiles) = listStartupIssues([proj](#shtbu4j88b-01%5Fsep%5Fmw%5F56667886-df27-4faf-868a-62680206145f),[Name=Value](#namevaluepairarguments))
specifies additional options using one or more name-value arguments. For example, to exclude checking issues in referenced projects, set theIncludeReferences argument tofalse
.
Examples
Use currentProject
to create a project object from the currently loaded project.
Get all startup issues in the loaded project.
projectStartupIssues = listStartupIssues(proj)
projectStartupIssues =
1×2 Issue array with properties:
ID
Details
ProblemFiles
ProjectRoot
Exception
Find information about the first project startup issue. The issue occurs when the project attempts to run MATLAB® code on startup.
firstIssue = projectStartupIssues(1)
firstIssue =
Issue with properties:
ID: "Project:Issues:RunMatlabCode"
Details: ""
ProblemFiles: "C:\WorkSpace\ProjectIssuesExample\startupscript.m"
ProjectRoot: "C:\WorkSpace\ProjectIssuesExample"
Exception: [1×1 MException]
Find information about the error that the MException
object stores.
exceptionInfo = firstIssue.Exception
exceptionInfo =
MException with properties:
identifier: 'shared_cmlink:git:RepositoryNotFound'
message: ''C:\WorkSpace\ProjectIssuesExample' is not inside a Git repository.'
cause: {}
stack: [4×1 struct]
Correction: []
Use currentProject
to create a project object from the currently loaded project.
Determine if the project has startup issues due to shadowed files. TheProblemFiles
property lists the files that shadow files in the project.
issues = listStartupIssues(proj,ID="Project:Issues:ShadowingFile")
issues =
Issue with properties:
ID: "Project:Issues:ShadowingFile"
Details: "1 model shadowed by:"
ProblemFiles: "C:\WorkSpace\topLevelModel.slx"
ProjectRoot: "C:\WorkSpace\ProjectIssuesExample"
Exception: []
Fix the startup issue by closing the shadowing files.
shadowingFiles = issues.ProblemFiles; for idx = 1:length(shadowingFiles) close_system(shadowingFiles(idx)); end
Input Arguments
Project, specified as a matlab.project.Project
object. Use currentProject to create a project object from the currently loaded project.
Name-Value Arguments
Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN
, where Name
is the argument name and Value
is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.
Example: issues = listStartupIssues(proj,IncludeReferences=false,ID="Project:Issues:RunMatlabCode")
returns issues related to running MATLAB code during the top-level project startup.
Option to include issues in referenced projects, specified as a numeric or logical 1
(true
) or0
(false
).
Data Types: logical
Project issue identifier, specified as a string or character vector.
Data Types: string
| char
Output Arguments
Project startup issues, returned as an array ofmatlab.Project.Issue
objects.
Version History
Introduced in R2025a