MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1
folder to a project, the project checks advise you to remove this from the project and offer
to make the fix.

It is also a best practice is to exclude derived files from source control, because they can
cause problems. This includes .mex files, the contents of the resources folder, or other
code generation folders. For example:


  • With a source control system that can do file locking, you can encounter conflicts. If
    resources is under source control and you generate code, most of the files under
    resources change and become locked. Other users cannot generate code because of
    file permission errors. Locking binaries, such as .mex files, can have an impact on a
    team.

  • Deleting resources is often required. However, deleting resources causes
    problems such as not a working copy errors if the folder is under some source
    control tools (for example, SVN).

  • If you want to check in the generated code as an artifact of the process, it is common
    to copy some of the files out of the resources cache folder and into a separate
    location that is part of the project. That way, you can delete the temporary cache
    folder when you need to. Use the packNGo function to list the generated code files,
    and use the project API to add them to the project with appropriate metadata.

  • The resources folder can contain many small files. This can affect performance with
    some source control tools when each of those files is checked to see if it is up-to-date.


Find Project Files With Unsaved Changes


You can check your project for files with unsaved changes. On the Project tab, in the
Tools section, click Unsaved Changes.

In the Unsaved Changes dialog box, you can see all project files with unsaved changes. If
you have referenced projects, files are grouped by project. You can save or discard all
changes.

Manage Open Files When Closing a Project


When you close a project, if there are files with unsaved changes, a message prompts you
to save or discard changes. You can see all files with unsaved changes, grouped by project
if you have referenced projects. To avoid losing work, you can save or discard changes by
file, by project, or globally.

31 Projects

Free download pdf