필터 지우기
필터 지우기

Comparing two versions of a data dictionary programmatically

조회 수: 23 (최근 30일)
John Fiaschetti
John Fiaschetti 2023년 6월 20일
댓글: John Fiaschetti 2023년 6월 26일
HI all,
I have some users who either do not have access to Matlab or are not well-versed in its use who need to be able to compare two versions of the same data dictionary. I know there is a diff tool for this when you're in Simulink. I need to able to launch it from a Matlab compiled application and let the user select the two files. The two files would most likely be two different commits in a git repo.
Thanks!

답변 (1개)

Vishnu
Vishnu 2023년 6월 21일
Hi John,
  1. you can use the system command in MATLAB to call the Simulink diff tool from your compiled application.
  2. You can also use the uigetfile function to allow the user to select the two files to compare.
Here is a sample code that launches the Simulink diff tool and allows the user to select the two files:
[filename1, pathname1] = uigetfile('*.sldd', 'Select the first file to compare');
if filename1 == 0
return;
end
[filename2, pathname2] = uigetfile('*.sldd', 'Select the second file to compare');
if filename2 == 0
return;
end
cmd = sprintf('slddDiff(''%s'', ''%s'')', fullfile(pathname1, filename1), fullfile(pathname2, filename2));
system(cmd);
% The slddDiff function takes two input file paths and compares them.
% we use the system command to execute the Simulink diff tool with the constructed command.
  댓글 수: 2
John Fiaschetti
John Fiaschetti 2023년 6월 21일
I'll try it out ASAP. Thanks!
John Fiaschetti
John Fiaschetti 2023년 6월 26일
slddDiff() doesn't appear to exist. Is it a custom function someone created?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by