Skip to main content
Question

Uploading multiple merit function via loop in MATLABStandaloneApplication code

  • November 14, 2024
  • 1 reply
  • 65 views

Rahul

Hello, 

I am working on designing lenses (Intraocular lens) of a power range and each power has unique merit function. I could manage to load merit function using the command below - 

TheMFE = TheSystem.MFE;

mf3_filename = System.String.Concat(sampleDir,'\API\Matlab\MeritFunc\10.0D MF.MF');

TheMFE.LoadMeritFunction(mf3_filename);

 

In the same location I have merit functions for different power lenses. Can anyone suggest me a way how can I successfully load power specific merit function?

Thanks in advance!

 

Regards,

Rahul

1 reply

Hi Rahul,

It seems to me that you can adjust the filename of the merit function, or am I missing something? I am not that proficient with matlab, but something like this should work to loop through them:
 

TheMFE = TheSystem.MFE;


powers = [10.0, 10.5, 11.0];
for i = 1:length(values)
    mf3_filename = sprintf('%s\\API\\Matlab\\MeritFunc\\%.1fD MF.MF', sampleDir, powers(i));
    TheMFE.LoadMeritFunction(mf3_filename);

    % ...
end

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings