imagej / imagej/imagej-matlab

When should MATLAB variables be cleared?

Open
#6 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
16
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Currently, we never explicitly clear MATLAB workspace variables before executing a script. This could lead to stale variables interfering with script execution.

I think we should probably never clear variables when running from within MATLAB, as MATLAB is the host environment and ImageJ.

When running from within ImageJ and calling MATLAB remotely, I think we may not want to clear variables if the UI is visible (as the user may want to inspect and modify things manually in this case). If the UI is hidden, I think there is a valid argument for wanting to clear the workspace.

That said, I do think clearing the workspace is putting a burden on the user to design a single script that "does everything" - the expectation being that MATLAB acts like a fully functional language. Until ImageJ-MATLAB can handle both script and function paradigms I think we may just want to accept that there are side-effects.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named. Trace how scripts are executed from MATLAB and remotely through ImageJ, including whether the MATLAB UI is visible. The issue needs a settled policy for workspace clearing before implementation can be considered done.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.