matlabopen

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 5.1, Creation date: 2022-01-21, Last change: 2025-08-19

open the matlab application on mac

Description

Some more complex matlab programms such as "fourbardesignbysiri" use different other application programms such as Filemaker or quickcams etc.
By starting those external applications by function openbydoubleclick, the mouse focus switch to the new called application, and typed letters are processed in a different app. This is very confusing for a user. Therefor, the function openbydoubleclick will use matlabopen to switch the user control back to matlab if this is desired.
Currently tested only on mac osx using
- cura
- SGfilemaker
- quickcamopen

See Also: openbydoubleclick , editorwindow

Example Illustration

 missing image of matlabopen

Syntax

matlabopen




Copyright 2022-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, named matlabopen, is designed to open the MATLAB application on a macOS system. It is part of the SG-Library and was created by Tim Lueth. The function is particularly useful when working with complex MATLAB programs that interact with other applications, ensuring that the user control is switched back to MATLAB if needed.

Input Parameters

The function matlabopen does not take any input parameters. It is a standalone function that operates based on the system's environment.

Algorithm Steps

  1. The function first checks if the operating system is macOS using the ismac function.
  2. If the system is macOS, it retrieves the MATLAB version using the verML function and extracts the version number using strtok.
  3. It constructs the file path to the MATLAB application using the version number, assuming the application is located in the /Applications directory with a naming convention of MATLAB_[version].app.
  4. The function then uses the system command to open the MATLAB application by executing the open command with the constructed file path.
  5. After opening MATLAB, it calls the commandwindowTL function to bring the MATLAB command window to the front, ensuring user focus is returned to MATLAB.
  6. There is a commented-out line that suggests the function could also call openbydoubleclick with the file path, an empty string, and false as arguments to avoid recursion. However, this line is not executed in the current implementation.

Additional Information

The function is specifically tested on macOS with applications like Cura, SGfilemaker, and Quickcamopen as of January 21, 2022. It was introduced in SolidGeometry version 5.1.

Algorithm explaination created using ChatGPT on 2025-08-19 01:03. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21