File Exchange

image thumbnail

Programmatically scroll Variables Editor

version (470 KB) by Oleg Komarov
Opens a variable in the Variables Editor (grabs focus if open) and scrolls to position.


Updated 30 Oct 2016

From GitHub

View Version History

View license on GitHub

EXISTING/NEW ISSUES (or enhancement requests):
- Please, check and report new issues to
- If a new issues occurs, provide all steps to reproduce it, even if it means including a "restart the pc" step.
Opens a variable in the Variables Editor (grabs focus if already open) and scrolls to given position/subs.
Supported scrollable classes (matrices):
* numeric
* logical
* cell
* timeseries
* table (from R2013b - v2.1)
* categorical (from 2013b - v2.1)
* dataset (Statistics Toolbox)


% Scroll a simple logical variable
a = false(1e6,100);
pos = randi(1e8,1);

% Scroll somewhere else
scrollto('a',[1e5, 28])

% Wrap into a structure and scroll the indexed variable = a;

% Wrap into cell and scroll with several levels of nesting
c = {s};
scrollto('c{1}.foo', pos)

% Scroll 3D array
a = rand(10,10,10);

WARNING: this code heavily relies on undocumented and unsupported Matlab functionality.


Cite As

Oleg Komarov (2021). Programmatically scroll Variables Editor (, GitHub. Retrieved .

Comments and Ratings (6)

Edgars Stegenburgs


This is very useful. I have found one repeatable error, at least when using tables. On first use, whether the variable is already in VE or not, the right row is highlighted but the row is not generally visible. The table is scrolled to somewhere further down the table. With a large row number, the error can be quite large. Simply reissuing the command makes the right row visible, and all subsequent calls do likewise. So, there appears to be some minor initialization issue. The workaround (issuing the first command twice) is simple and effective. Just thought it might be a useful heads up to the developer (to whom, many thanks for this useful solution to a noxious problem).

Oleg Komarov

@Klaus: the code is hosted on github and you can raise an issue there outlining the feature request and suggesting a solution, or you can submit a pull request directly with your changes!

Klaus Rezepka

I have found a basic implementation for scrolling struct arrays which works well for me. Pls. contact me if you need further details.

Klaus Rezepka

Very useful indeed.
Unfortunately struct arrays do not seem to be scrollable in M2013b.
What would be the way to implement this?


MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!