想跟大家詢問一下 我這邊寫了一組matlab code去抓出公差,但不知道要怎麼把matlab的代碼轉成python去做控制,以下是我想改的matlab代碼,想請問有沒有甚麼方法可以轉成python呢? ~~~ function [ r ] = MATLABStandaloneApplication( args ) if ~exist('args', 'var') args = [];end % Initialize the OpticStudio connectionTheApplication = InitConnection();if isempty(TheApplication) % failed to initialize a connection r = [];else try r = BeginApplication(TheApplication, args); CleanupConnection(TheApplication); catch err CleanupConnection(TheApplication); rethrow(err); endendend function [r] = BeginApplication(TheApplication, args) import ZOSAPI.*; TheSystem = TheApplication.PrimarySystem; %Figure Setting xA = "Two Mirror Gap Change (um)"; yA = "Contrast"; yA1 = "Contrast Deformation"; Leg1 = ['X - Contrast'; 'Y - Contrast']; Ptitle = 'Contrast in X/Y vs. 2 Mirror Gap'; Ptitle1 = 'Contrast Deformation vs. 2 Mirror Gap'; sqn = 20; % Set up primary optical system% TheSystem = TheApplication.PrimarySystem; sampleDir = TheApplication.SamplesDir; % Open file testFile = System.