SGopentoline

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CODING/DEVELOP
Introduced first in SolidGeometry 5.1, Creation date: 2021-11-02, Last change: 2025-09-15

same as opentoline which does not work anymore in 2020b Update6 on Catilina

Description

simply the same as matlab.desktop.editor.openAndGoToLine(which(fname),line)

See Also:

Example Illustration

 missing image of SGopentoline(fname,line)

Syntax

SGopentoline(fname,line)

Input Parameter

fname: filename
line: line number

Examples


SGopentoline('PLcircle',20)




Copyright 2021-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, SGopentoline, is designed to open a specified file in the MATLAB editor and navigate to a specific line number. It is a workaround for the opentoline function, which may not work in certain MATLAB versions.

Input Parameters

Algorithm Steps

  1. The function first resolves the full path of the file using the which function. This ensures that the correct file is located, even if it is not in the current directory.
  2. It checks if the code is running in a deployed application using isdeployed. If the code is not deployed, it proceeds to the next step.
  3. The function then calls matlab.desktop.editor.openAndGoToLine with the resolved filename and the specified line number. This opens the file in the MATLAB editor and navigates to the specified line.

Example Usage

To open the file PLcircle and navigate to line 20, you would call the function as follows:

SGopentoline('PLcircle', 20)

This function is part of the SolidGeometry library and was introduced in version 5.1. It is categorized under auxiliary procedures and was created by Tim C. Lueth.

Algorithm explaination created using ChatGPT on 2025-08-18 22:44. (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