okomarov / scrollto Goto Github PK
View Code? Open in Web Editor NEWMatlab function to programmatically scroll the Variables Editor of the IDE
Matlab function to programmatically scroll the Variables Editor of the IDE
I tried out this utility today, and I'm encountering the following error when running the example code (Win10, R2018aU4). I can reproduce this locally by clearing the workspace and running all commands "at once" (i.e. via "Run" or "Run Section", and not line-by-line).
a = false(1e6,100);
pos = randi(1e8,1);
scrollto('a',pos)
Initial error:
Error while evaluating TimerFcn for timer 'timer-1'
Undefined function 'getRowCount' for input arguments of type
'javahandle_withcallbacks.com.mathworks.mde.array.ArrayEditor'.
After clearing the workspace manually and re-running the example:
Undefined function 'getRowCount' for input arguments of type
'javahandle_withcallbacks.com.mathworks.mde.array.ArrayEditor'.
Error in scrollto (line 148)
row = min(pos(1)-1, h.getRowCount-1);
When running the code a second time after the error happened (now that the variables are created), there is no problem. This appeared to be a race condition, but even when I surrounded the offending line with a "failsafe", it just resulted in an infinite loop.
... L146
while true
try
% Rebase to 0 and bound to max scrollability if pos is not a scalar
row = min(pos(1)-1, h.getRowCount-1);
col = min(pos(2)-1, h.getColumnCount-1);
break;
catch
pause(0.05)
% h = findjobj(desktop.getClient(name),'property',{'name',typeName}); % has no effect
end
end
I also tried reassigning h
inside the catch
, but this too did not help.
Suppose you have the following dataset:
d = mat2dataset(rand(5));
Scrolling to the 7th position, i.e. in subscripts terms to d(2, 2)
, selects the 7th cell in the first row:
scrollto('d',7)
Now, the workaround is to supply pos
as subscripts directly.
Check why the internal position to subscript conversion fails.
The following image shows the effect on the row height after using scrollto()
on variable a
:
To reproduce the problem:
a = rand(3)
b = rand(3)
scrollto('a',4)
The problem might be caused by the Java method updateUI()
which I originally use to avoid flickering and artifacts in the Variables Editor rendering.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.