Running Igor as a server automation with MatLab as a client

Hi,

I'm a physical engineer undergraduate following an internship for the summer.
I have been given the task to speed up a data loading/fitting routine on Igor.
The routine has to go through some 7000 ASCII text files, and fit the data using an initial guess supplied by the user.
It works fine, but the waves eat up a lot of memory, and the process becomes slow toward the end.
I think that MatLab's (not sure) better suited to store the information (raw data + fit parameters) in a giant cell object in it's workspace.
So I want to make a MatLab GUI with ActiveX control, making use of Igor's fitting capabilities, returning results of a fit after each one.

Unfortunately, I am having trouble just connecting Igor with Matlab on Windows.
Matlab has a function (actxcontrollist) that permits the user to see which COM controls are installed on the system.
Normally, it is simple to connect to another application with MatLab's ActiveX control.
However, I do not find any reference to IgorPro.Application, or anything that has Igor in it's name for that matter.

I was wondering whether this could be an installation problem or if I misunderstood how to connect with Igor.

This might be a basic question, but as a novice programmer, I have no idea what to do from here.
In any case, thanks in advance,
Nicolas
Igor can serve as an ActiveX Automation server. To read about this open "Igor Pro Folder\Miscellaneous\Windows Automation\Automation Server.ihf" in Igor. Doing this requires programming expertise in Visual Basic, Visual C++ or Visual C#. It is pretty complicated.

Involving Matlab sounds like a bad idea to me.

First make sure that you are not keeping data in Igor longer than you need it. i.e., kill waves that you are no longer using. If you are not using Igor Pro 6.2x or 6.3x you should update - memory management was improved in recent versions.

Next if you have a large number of waves loaded into memory at one time - say in the hundreds or thousands, use data folders to keep the number of waves in any given data folder down to a reasonable number.

If you are fitting to a user-defined fitting function write the function as an external function using the Igor XOP Toolkit. This will give a significant speed increase for most user-defined fitting functions.

If and only if you must keep more than a gigabyte or two of data in memory at one time then use IGOR64.


N.Duc wrote:
I think that MatLab's (not sure) better suited to store the information (raw data + fit parameters) in a giant cell object in it's workspace.
So I want to make a MatLab GUI with ActiveX control, making use of Igor's fitting capabilities, returning results of a fit after each one.


I doubt that this is a good strategy.

In any problem like this you first need to diagnose what the problems are. Once you have diagnosed the issues, fix them or post a description so that we can offer advice or help you out. In addition to hrodstein's suggestions, you can also consider profiling the code. Once you have identified 'hot spots' either redesign the code or post these here for suggestions.
Thanks a lot for your help and ideas!
I was actually thinking that my initial plan was probably not the best.
I was just being lazy about learning a new programming language.
In any case, I will try to optimise the procedure.

Cheers