Add new shared code source files to existing shared code folder
copies, for example, shared utility files from
sourceFolder to a
destinationFolder provided that the files do not exist
destinationFolder. The function:
Identifies files in both folders that have identical names but different content. The function does not overwrite these files in
destinationFolder. In the Command Window, you see a
comparelink for each file. To examine differences by using the Comparison tool, click the link.
sourceFolderfiles that the function intends to copy and seeks confirmation. When you provide confirmation, the function copies the files to
destinationFolder. By default, the destination of the copied files is a subfolder that corresponds to the release in which the files were created, for example,
Copy Shared Utility Files to Shared Code Folder
This example shows how to copy source files from a shared utilities folder to a shared code folder.
sourceFolder = fullfile(pwd,'R2015bWork','slprj','ert','_sharedutils'); existingSharedCodeFolder = fullfile(pwd,'SharedUtilCode'); sharedCodeUpdate(sourceFolder, existingSharedCodeFolder);
Copy Shared Utility Files to Subfolder
This example shows how to copy source files from a shared utilities folder to a specified subfolder in the shared code folder.
sourceFolder = fullfile(pwd,'R2015bWork','slprj','ert','_sharedutils'); existingSharedCodeFolder = fullfile(pwd, 'SharedUtilCode'); destinationSubfolder = 'mySub' sharedCodeUpdate(sourceFolder, existingSharedCodeFolder,... 'ExistingCodeSubfolder', destinationSubfolder);
Copy Shared Utility Files From Relocated Code Folder
This example shows how to copy shared utility files from a relocated generated code folder to an existing shared code folder.
Specify path to shared code folder that you want to update.
pathToExistingSharedFolder = 'C:\mySharedCodeFolder';
Specify the full path to the relocated generated code folder
anchorFolder = 'C:\myWorkFolder'; relocatedCodeFolder = fullfile(anchorFolder, 'P1_ert_rtw');
Update the existing shared code folder.
sourceFolder — Source folder
File path to folder with shared code files that you want to add to existing shared code folder.
destinationFolder — Existing shared code folder
File path to existing shared code folder.
destinationSubfolder — Destination subfolder
Destination subfolder in existing shared code folder.
buildFolder — Build folder
Path to a Code generation folder that contains previously generated model code.
configurationSetOrModel — Configuration set or model
Simulink configuration set or model that uses an existing shared code folder specified by
protectedModel — Protected model file
File path for protected model. File name of protected model must have
Introduced in R2016b