Undocumented Matlab
  • SERVICES
    • Consulting
    • Development
    • Training
    • Gallery
    • Testimonials
  • PRODUCTS
    • IQML: IQFeed-Matlab connector
    • IB-Matlab: InteractiveBrokers-Matlab connector
    • EODML: EODHistoricalData-Matlab connector
    • Webinars
  • BOOKS
    • Secrets of MATLAB-Java Programming
    • Accelerating MATLAB Performance
    • MATLAB Succinctly
  • ARTICLES
  • ABOUT
    • Policies
  • CONTACT
  • SERVICES
    • Consulting
    • Development
    • Training
    • Gallery
    • Testimonials
  • PRODUCTS
    • IQML: IQFeed-Matlab connector
    • IB-Matlab: InteractiveBrokers-Matlab connector
    • EODML: EODHistoricalData-Matlab connector
    • Webinars
  • BOOKS
    • Secrets of MATLAB-Java Programming
    • Accelerating MATLAB Performance
    • MATLAB Succinctly
  • ARTICLES
  • ABOUT
    • Policies
  • CONTACT

Undocumented feature() function

May 4, 2010 27 Comments

Taking a short break from Java-related stuff in Matlab, I wanted to share and expand a reply I posted a short while ago on the StackOverflow forum, in response to a reader’s request to explain Matlab’s feature function. This article uses pure Matlab and is absolutely unrelated to Java, so those of you who are Java-phobic can be at ease trying this at home…
feature is an entirely undocumented and unsupported Matlab function, and unlike most other undocumented Matlab functions it actually does often change without prior notice between Matlab releases, so be very careful when using this function in your code.
feature accepts two arguments: the name of the feature and an optional new value. This is similar to get/set functions: When only one argument is supplied, Matlab returns the current feature value (like get), otherwise the value is modified (like set). In some rare cases (feature(‘timing’)), a third input argument is sometimes expected.
Feature names are case-insensitive. The built-in function system_dependent appears to be a synonym for feature (not exactly – some system_dependent features are unavailable in feature…). We can find several references to system_dependent online, mostly for old Matlab releases. There’s even an entry in the official Matlab FAQ (which has no usful info), and I’ve seen online references going all the way back to 1993…
One of the very rare official comments about this function says:

The system_dependent function is an unpublished function that we use for a variety of crufty things. It will most certainly change from time to time and possibly even go away completely. The system_dependent function performs different functionality on each of the platforms supported by MATLAB.

Several feature options have been reported over the years, mainly on the CSSM forum and also seen in the installed Matlab code base, as listed below (the code references are from the latest Matlab release – 7.10, aka R2010a). Note that many of these features may not work on your platform:

  • feature(‘usehg2’,flag) – this apparently relates to a new Handle-Graphics implementation that is under development for the past few years (I think I saw references to HG2 as far back as 2007, possibly earlier). HG2 is automatically active when Matlab is started with -hgVersion 2 option. It appears that the numeric HG handles have been replaced with their object-oriented (Matlab class system) handle counterparts in HG2 (today these class-system handles can be gotten using the handle function). Some handle properties are not implemented in HG2, and some GUI elements appear missing (figure menubar and toolbar, for example), but the basic plots look similar to our familiar HG. If anyone has any further information about HG2 I would love to hear it…
  • feature(‘useGBT2’) – “feature(‘useGBT2’) is only available when Matlab is started with -hgVersion 2 option.” – In /ja/xlate:15419; also see in: clf.m
  • feature(‘HGUsingMatlabClasses’) – see hgrc.m, subplot.m, title.m, xlabel.m, ylabel.m, zlabel.m, mesh.m, surf.m, colorbar.m etc. etc.
  • feature(‘JavaFigures’) – see propedit.m; disabled since R2007a when native (non-Java) Matlab figures were disabled.
  • feature(‘UseJava’) – see usejava.m
  • feature(‘ClearJava’,1) – see javaclasspath.m
  • feature(‘SetPrecision’) – accepts values 24, 53 or 64
  • feature(‘SetRound’) – accepts values 0, 0.5, Inf or -Inf
  • feature(‘IsDebug’) – see here; controls Matlab assertions.
  • feature(‘NewPrintAPI’) – see \toolbox\matlab\graphics\private\setup.m
  • feature(‘accel’,’on/off’) – see here and here. There is also a related feature(‘JIT’,’on/off’) which appears to control a subset of feature(‘accel’).
  • feature(‘GetOS’) – see ver.m
  • feature(‘GetWinSys’) – see ver.m
  • feature(‘GetPid’) – returns the Matlab process ID (well, actually the PID of its JVM but that’s the same PID as Matlab’s). Also see the similar java.lang.management.ManagementFactory.getRuntimeMXBean.getName.char. This latter function returns the PID mangled with the computer name (for example: ‘1234@My-desktop’).
  • feature(‘GetCPU’) – see daqsupport.m (Data Acquisition Toolbox) and here
  • feature(‘NumCores’) – returns the number of CPU cores seen by Matlab
  • feature(‘NumThreads’) – see here
  • feature(‘MemStats’), feature(‘DumpMem’), feature(‘ProcessMem’) – these are memory reports that are even recommended by official MathWorks tech notes (1,2), newsletter and technical solutions (1,2). Numerous references to these features can be found online.
  • feature(‘CheckMallocMemoryUsage’) – see this official technical paper
  • feature(‘CheckMallocHeapWalk’) – see here
  • feature(‘ShowCommandWindow’) – see here = commandwindow
  • feature(‘LogDir’) – see here = tempdir
  • feature(‘HotLinks’) – used to disable hyperlinks in the Command Window. This is used by Word notebooks (see mwMatlabEval macro in the Microsoft Word template file %matlabroot%\notebook\pc\M-BOOK.DOT). Also see: info.m, mlint.m, doclink.m, guidefunc.m, displayEndOfDemoMessage.m
  • feature(‘UseOldFileDialogs’) – see toolbox\matlab\uitools\private\usejavadialog.m
  • feature(‘timing’) – For example: cpucount = feature(‘timing’,’cpucount’); There are several other 2nd arg options, as explained by the following informative error message:
    >> feature timing
    ??? Error using ==> feature
    Choose second argument from:
      'resolution_tictoc'  - Resolution of Tic/Toc clock in sec (double)
      'overhead_tictoc'    - Overhead of Tic/Toc command in sec (double)
      'cpucount'           - Current CPU cycles used (uint64) [Using utCPUcount]
      'getcpuspeed_tictoc' - Stored CPU cycles/sec (double) [Used by tic/toc]
      'cpuspeed'           - Current CPU cycles/sec (double) [Simple MathWorks]
      'winperfcount'       - Current CPU cycles used (uint64) [Windows call]
      'winperfspeed'       - Current CPU cycles/sec (double) [Windows call]
      'wintime'            - Current Windows time (uint32) [Windows call]
                             units: msec since startup [Wraps]
      'wintimeofday'       - Current time of day converted to file time (unit64)[Windows call]
                             units: 100 nsec since 01-Jan-1601 (UTC)
      'clocks_per_sec'     - clock() speed in cycles/sec [CLOCKS_PER_SEC]
    Choose second and third arguments from:
      'cpuspeed', double num             - Current CPU cycles/sec (double) [MathWorks - num iterations]
      'setcpuspeed_tictoc', double speed - Set the CPU cycles/sec [Used by tic/toc]
       uint64 arg2, uint64 arg3          - uint64 difference = arg2 - arg3 (uint64)

    >> feature timing ??? Error using ==> feature Choose second argument from: 'resolution_tictoc' - Resolution of Tic/Toc clock in sec (double) 'overhead_tictoc' - Overhead of Tic/Toc command in sec (double) 'cpucount' - Current CPU cycles used (uint64) [Using utCPUcount] 'getcpuspeed_tictoc' - Stored CPU cycles/sec (double) [Used by tic/toc] 'cpuspeed' - Current CPU cycles/sec (double) [Simple MathWorks] 'winperfcount' - Current CPU cycles used (uint64) [Windows call] 'winperfspeed' - Current CPU cycles/sec (double) [Windows call] 'wintime' - Current Windows time (uint32) [Windows call] units: msec since startup [Wraps] 'wintimeofday' - Current time of day converted to file time (unit64)[Windows call] units: 100 nsec since 01-Jan-1601 (UTC) 'clocks_per_sec' - clock() speed in cycles/sec [CLOCKS_PER_SEC] Choose second and third arguments from: 'cpuspeed', double num - Current CPU cycles/sec (double) [MathWorks - num iterations] 'setcpuspeed_tictoc', double speed - Set the CPU cycles/sec [Used by tic/toc] uint64 arg2, uint64 arg3 - uint64 difference = arg2 - arg3 (uint64)

  • feature(‘memtic’), feature(‘memtoc’) – possibly related to feature(‘timing’); mentioned in /ja/xlate:5780-5781
  • feature(‘locale’) – see mlint.m, mtree.m, helpmenufcn.m
  • feature(‘DefaultCharacterSet’) – see here
  • feature(‘COM_SafeArraySingleDim’) – explained here and here.
  • feature(‘COM_ActxProgidCheck’,flag) – see /help/techdoc/helpsearch/_533.cfs
  • feature(‘FigureTools’) – see domymenu.m
  • feature(‘TimeSeriesTools’,1) – see /help/techdoc/helpsearch/_533.cfs
  • feature(‘launch_activation’, ‘forcecheck’) – see StudentActivationStatus.m
  • feature(‘EightyColumns’,flag) – see matlabrc.m
  • feature(‘GetSharedLibExt’) – see loadlibrary.m and /toolbox/matlab/audiovideo/private/privateMMReaderPluginSearch.m
  • feature(‘GetDefaultPrinter’) – see printdlg.m, printopt.m
  • feature(‘GetPrinterInfo’) – see pagesetupdlg.m
  • feature(‘GetPrinterColor’) – see /toolbox/matlab/graphics/private/defaultprtcolor.m
  • feature(‘GetSpecifiedPrinterPort’,printerName) – see /toolbox/matlab/graphics/private/send.m
  • feature(‘ShowFigureWindows’) – see printjob.m, printtables.m, /toolbox/matlab/graphics/private/warnfiguredialog.m
  • feature(‘SearchUDDClassesForHelp’) – see /toolbox/matlab/helptools/+helpUtils/@HelpProcess/getHelpText.m
  • feature(‘AutomationServer’) – see notebook.m, enableservice.m = enableservice(‘AutomationServer’, true)
  • feature(‘EnableDDE’,flag) – see enableservice.m = enableservice(‘DDEServer’, true)
  • feature(‘GetUserWorkFolder’) – see userpath.m, savepath.m
  • feature(‘DirsAddedFreeze’), feature(‘DirsAddedUnfreeze’) – see addpath.m
  • feature(‘ToolboxFreeze’), feature(‘ToolboxUnfreeze’) – explained here
  • feature(‘DirChangeHandleWarn’) – accepts ‘always’, ‘once’, ‘never’ or ‘status’. Mentioned in an official Matlab technical solution and also in changeNotificationAdvanced.m.
  • feature(‘DirReloadMsg’) – accepts ‘on’, ‘off’ or ‘status’. See changeNotificationAdvanced.m and here.
  • feature(‘RemoteCWDPolicy’) – accepts ‘Reload’, ‘TimecheckDir’, ‘TimecheckDirFile’, ‘TimecheckFile, ‘None’ or ‘status’. See changeNotification.m and here.
  • feature(‘RemotePathPolicy’) – accepts ‘Reload’, ‘TimecheckDir’, ‘TimecheckDirFile’, ‘TimecheckFile, ‘None’ or ‘status’. See changeNotification.m, here and this official technical solution.
  • feature(‘GetPref’,prefName) – returns the system preference value for the requested preference name in the global prefs file ([prefdir,’/matlab.prf’]) that is explained here.
  • feature(‘IsDebugMode’) – mentioned here and several other online places
  • feature(‘ForceFramesOnBottom’) – mentioned here

Oddly, some features are only accessible via system_dependent, and not via feature:

  • system_dependent(‘builtinEditor’,flag) – see matlabrc.m
  • system_dependent(‘miedit’,filename) – referenced here, here and in edit.m. See matlabrc.m.
  • system_dependent(4,…) – See cedit.m, arrayviewfunc.m, dbmex.m, mexdebug.m. In addition to 4, I have seen references to features #2, 7-14, 44, 45, 1000-1003.
  • system_dependent(12,flag) – See %matlabroot%\notebook\pc\M-BOOK.DOT macro InitFromSavedSettings.

The following are OpenGL-related features that are used in the opengl.m function:

  • feature(‘OpenglMode’)
  • feature(‘OpenGLLoadStatus’)
  • feature(‘UseMesaSoftwareOpenGL’,1)- unix only
  • feature(‘UseGenericOpengl’,1)
  • feature(‘GetOpenglInfo’) = opengl(‘info’)
  • feature(‘GetOpenglData’) = opengl(‘data’)
  • feature(‘OpenGLVerbose’,1)

If you lasted this far you deserve a special treat: Last but not least we have feature(‘dwim’). Unfortunately, this feature sometimes fails on some systems…
Have you discovered or used any interesting feature? If so, please do share them in the comments section below

Related posts:

  1. Undocumented feature list – A list of undocumented MATLAB features can be retrieved. Here's how... ...
  2. ismembc – undocumented helper function – Matlab has several undocumented internal helper functions that can be useful on their own in some cases. This post presents the ismembc function....
  3. sprintfc – undocumented helper function – The built-in sprintfc function can be used to quickly generate a cell-array of formatted strings. ...
  4. More undocumented timing features – There are several undocumented ways in Matlab to get CPU and clock data...
  5. The HotLinks feature – feature('HotLinks') can be used to temporarily disable hyperlinks and other markups in the Matlab console. ...
  6. Legend '-DynamicLegend' semi-documented feature – The built-in Matlab legend function has a very useful semi-documented feature for automatic dynamic update, which is explained here....
HG2 Pure Matlab Undocumented function
Print Print
« Previous
Next »
27 Responses
  1. Donn Shull May 4, 2010 at 10:02 Reply

    Hi Yair, the following feature is only useful to people with Simulink and Real-Time Workshop Embedded Coder. If you open a block diagram for example:

    >> rtwdemo_fuelsys

    >> rtwdemo_fuelsys

    you can obtain the object instance for your block diagram with:

    >> obj = get_param(bdroot, 'UDDObject')

    >> obj = get_param(bdroot, 'UDDObject')

    This object has a lot of useful methods but many of them raise an exception for example:

    >> obj.getCompiledBlockList
    ??? Simulink engine interface is not enabled.

    >> obj.getCompiledBlockList ??? Simulink engine interface is not enabled.

    Using the engine interface feature will enable those methods

    >> feature('EngineInterface', 1)

    >> feature('EngineInterface', 1)

    Will enable those methods.

    On a related topic as an alternative to using handle to obtain the object for handle graphics items you can create them with a “package qualified” command and they will return the object rather than a numeric handle. for example:

    >> figObj = hg.figure
    figObj =
    	figure

    >> figObj = hg.figure figObj = figure

    Thanks for all the hard work,

    Donn

    • walderich August 27, 2014 at 00:42 Reply

      Thanks a lot for the “EngineInterface” feature. But in my case I had to set its value to 1001 to get it working. I tested this with Matlab versions R2010b-R2014a.

  2. Ondrej Konopka July 17, 2010 at 03:47 Reply

    Hi Yair, I found out additional features in R2008b. Meanings of features are obvious from names of features in case of features with capital letters. The rest of features i have no idea what it does.

    feature(‘alloclist‘)
    feature(‘CachePath‘)
    feature(‘CheckMallocClear‘)
    feature(‘CheckMallocDispTaggedCallSite‘)
    feature(‘CheckMallocEnableAsserts‘)
    feature(‘CheckMallocLogTaggedCallSites‘)
    feature(‘CheckMallocLog‘)
    feature(‘CheckMallocNumStackFrames‘)
    feature(‘CheckMallocTagCallSites‘)
    feature(‘CheckMemoryIntegrity‘)
    feature(‘ClearMemoryStats‘)
    feature(‘ClearPcodeStats‘)
    feature(‘CoreDump‘)
    feature(‘DirectoryFreeze‘)
    feature(‘DirectoryUnfreeze‘)
    feature(‘DirsAddedUnfreeze‘)
    feature(‘DumpHeap‘)
    feature(‘InteruptLongjumps‘)
    feature(‘IsDMLWorker‘)
    feature(‘LogAllStreams‘)
    feature(‘logfile‘)
    feature(‘pallalloc‘)
    feature(‘pallleaks‘)
    feature(‘pclalloc‘)
    feature(‘pclleaks‘)
    feature(‘pcovclear‘)
    feature(‘pcovdisable‘)
    feature(‘pcovenable‘)
    feature(‘pcovisrunning‘)
    feature(‘pcovsavedata‘)
    feature(‘pcovsetfilename‘)
    feature(‘plogprint‘)
    feature(‘pnewalloc‘)
    feature(‘pnewleaks‘)
    feature(‘PrintMemoryCacheStats‘)
    feature(‘PrintMemoryStats‘)
    feature(‘PrintPcodeStats‘)
    feature(‘prompt‘)
    feature(‘purify‘)
    feature(‘qclear‘)
    feature(‘qewait‘)
    feature(‘qsavefile‘)
    feature(‘qsave‘)
    feature(‘qstart‘)
    feature(‘qstop‘)
    feature(‘quantify‘)
    feature(‘TestUDD‘)
    feature(‘uddcount‘)
    feature(‘valgrind‘)
    feature(‘vlogprint‘)
    feature(‘vnewleaks‘)

    feature(‘alloclist‘) feature(‘CachePath‘) feature(‘CheckMallocClear‘) feature(‘CheckMallocDispTaggedCallSite‘) feature(‘CheckMallocEnableAsserts‘) feature(‘CheckMallocLogTaggedCallSites‘) feature(‘CheckMallocLog‘) feature(‘CheckMallocNumStackFrames‘) feature(‘CheckMallocTagCallSites‘) feature(‘CheckMemoryIntegrity‘) feature(‘ClearMemoryStats‘) feature(‘ClearPcodeStats‘) feature(‘CoreDump‘) feature(‘DirectoryFreeze‘) feature(‘DirectoryUnfreeze‘) feature(‘DirsAddedUnfreeze‘) feature(‘DumpHeap‘) feature(‘InteruptLongjumps‘) feature(‘IsDMLWorker‘) feature(‘LogAllStreams‘) feature(‘logfile‘) feature(‘pallalloc‘) feature(‘pallleaks‘) feature(‘pclalloc‘) feature(‘pclleaks‘) feature(‘pcovclear‘) feature(‘pcovdisable‘) feature(‘pcovenable‘) feature(‘pcovisrunning‘) feature(‘pcovsavedata‘) feature(‘pcovsetfilename‘) feature(‘plogprint‘) feature(‘pnewalloc‘) feature(‘pnewleaks‘) feature(‘PrintMemoryCacheStats‘) feature(‘PrintMemoryStats‘) feature(‘PrintPcodeStats‘) feature(‘prompt‘) feature(‘purify‘) feature(‘qclear‘) feature(‘qewait‘) feature(‘qsavefile‘) feature(‘qsave‘) feature(‘qstart‘) feature(‘qstop‘) feature(‘quantify‘) feature(‘TestUDD‘) feature(‘uddcount‘) feature(‘valgrind‘) feature(‘vlogprint‘) feature(‘vnewleaks‘)

    Hopefully, it helps you improve these pages. Thanks for the hard work as well.

    Ondrej

  3. Yves Piguet February 18, 2011 at 06:01 Reply

    Is this one known?

    feature list

    feature list

    Try

    l = feature('list');
    for i = 1:length(l)
      fprintf('%35s has_cb=%d has_bi=%d calls=%d val=%gn', ...
        l(i).name, l(i).has_callback, l(i).has_builtin, l(i).call_count, l(i).value);
    end

    l = feature('list'); for i = 1:length(l) fprintf('%35s has_cb=%d has_bi=%d calls=%d val=%gn', ... l(i).name, l(i).has_callback, l(i).has_builtin, l(i).call_count, l(i).value); end

    • Yair Altman February 18, 2011 at 06:40 Reply

      @Yves – this is fantastic 🙂

  4. Aurélien April 11, 2011 at 00:29 Reply

    Reading this bug report this morning : MATLAB crashes during debugging
    http://www.mathworks.com/support/bugreports/595677
    I discovered other feature commands and of cours I immediately think about sharing this on your blog :

    1. Turn off the JIT in the offending program file using the command “feature scopedAccelEnablement off”.
    2. Turn off the jitting of structures using the command “feature jitallow structs off”.
    3. Turn off the JIT completely using the command “feature accel off”

    • Yair Altman April 11, 2011 at 05:53 Reply

      Thanks for the tip, Aurélien 🙂

  5. Converting Java vectors to Matlab arrays | Undocumented Matlab December 14, 2011 at 11:55 Reply

    […] It so happens, that the undocumented built-in feature function (or its near-synonym system_dependent) enables improved performance […]

  6. Profiling Matlab memory usage | Undocumented Matlab March 1, 2012 at 08:43 Reply

    […] in release R2008a (but not on newer releases) we could also use a nifty parameter of the undocumented feature function: >> feature mtic; a=ones(100); feature mtoc […]

  7. damayi May 22, 2012 at 12:39 Reply

    Can you tell me what is the difference between feature(‘IsDebug’) and feature(‘IsDebugMode’);
    What’s more, I found that feature(‘IsDebugMode’) will always get false result when you run it in you m code, but in debug command, you can get true. why?

  8. Alexander October 23, 2012 at 09:47 Reply

    You could also add: system_dependent(7) which toggles command window text buffering. It can help if you output very large strings.

    Btw, is there a way to query the current state? Or set it to on/off (not just toggle)? I.e. I don’t want to toggle it on and off – I just want to turn that off once.

    • Yair Altman October 24, 2012 at 07:27 Reply

      @Alexander – I don’t think you can query or set the state of this specific feature. In other features you can, but not here.

  9. Rye April 2, 2013 at 12:09 Reply

    I found this feature while trying to debug a bizarre error I was having with a GPU function:

    feature('GpuAllocPoolSizeKb')

    feature('GpuAllocPoolSizeKb')

    found this here: http://www.mathworks.com/matlabcentral/answers/28500

    • Yair Altman April 2, 2013 at 14:17 Reply

      @Rye – thanks

  10. Using Java 7 in Matlab R2013a and earlier | Undocumented Matlab June 19, 2013 at 12:08 Reply

    […] R2013a does not have this problem; for R2012b a solution was found by setting the undocumented UseOldFileDialogs feature: feature('UseOldFileDialogs', […]

  11. Undocumented feature list | Undocumented Matlab March 19, 2014 at 11:02 Reply

    […] Three years ago I posted an article on Matlab’s undocumented feature function. feature is a Matlab function that enables access to undocumented internal Matlab functionality. […]

  12. Holger Krause April 3, 2014 at 07:28 Reply

    Matlab running on linux uses server-side font rendering. In case, the server doesn’t provide requested fonts, text in figures is rendered in a default font, and changes in fontsize are without effect. This can be overcome with:

    feature('javadrawingmethods',2)

    feature('javadrawingmethods',2)

    In this mode, java seems to do the text rendering wihout relying on Xservers capabilities.

    Tested in R2014a and R2013a.

  13. Unicode characters in MATLAB source files - DexPage July 9, 2015 at 10:25 Reply

    […] can read more about this undocumented function here. See also this Matlab Central thread for other […]

  14. Karel Lebeda September 23, 2016 at 17:01 Reply

    Is it me, is it Linux, or has this gone (in 2015a)?

    >> which feature
    built-in (undocumented)
     
    >> feature memstats
    Error using feature
    Feature memstats not found
     
    >> edit feature
    (opens /opt/MWmatlabR2015a/toolbox/distcomp/@distcomp/feature.m)

    >> which feature built-in (undocumented) >> feature memstats Error using feature Feature memstats not found >> edit feature (opens /opt/MWmatlabR2015a/toolbox/distcomp/@distcomp/feature.m)

    • Yair Altman September 23, 2016 at 18:05 Reply

      @Karel – feature memstats is a Windows-only feature

  15. matlab November 13, 2016 at 00:08 Reply

    Thanks for kind useful information.

  16. Kristian Loewe November 28, 2016 at 18:26 Reply

    It seems that feature(‘OpenGLLoadStatus’) has been dropped. It’s still available in R2014b but not in R2015b (Linux versions). Do you know if it’s still available in R2015a?

    • Yair Altman December 25, 2016 at 18:50 Reply

      @Kristian – yes, feature('OpenGLLoadStatus') works in R2015a. It would be interesting to know how you are using this feature – can you tell us?

      • Kristian Loewe March 7, 2017 at 12:46

        Thanks, Yair!

        I am using it to assert that OpenGL is available upon starting up a GUI that I am developing. The GUI requires OpenGL in order to work as expected.

  17. Erivelton Geraldo Nepomuceno May 12, 2017 at 20:04 Reply

    Hi,

    system_dep​endent(‘se​tround’,In​f) is still working on R2017a? Anyone has noticed something different? In previous version, I didn’t find any problem.

  18. Walter Roberson June 22, 2018 at 04:31 Reply
    feature('COM_PassSafeArrayByRef', 1)

    feature('COM_PassSafeArrayByRef', 1)

    to turn on passing SAFEARRAY by reference to COM objects.

    Described in MATLAB Answers 94888

    • Yair Altman June 25, 2018 at 22:02 Reply

      Thanks @Walter. Another related undocumented feature is

      feature('COM_SafeArraySingleDim', 1)

      feature('COM_SafeArraySingleDim', 1)

      , which makes SAFEARRAYs that are exported to COM objects 1-dimensional, rather than 2D (which is Matlab’s default). See discussion in Matlab Answers #94833.

Leave a Reply
HTML tags such as <b> or <i> are accepted.
Wrap code fragments inside <pre lang="matlab"> tags, like this:
<pre lang="matlab">
a = magic(3);
disp(sum(a))
</pre>
I reserve the right to edit/delete comments (read the site policies).
Not all comments will be answered. You can always email me (altmany at gmail) for private consulting.

Click here to cancel reply.

Useful links
  •  Email Yair Altman
  •  Subscribe to new posts (feed)
  •  Subscribe to new posts (reader)
  •  Subscribe to comments (feed)
 
Accelerating MATLAB Performance book
Recent Posts

Speeding-up builtin Matlab functions – part 3

Improving graphics interactivity

Interesting Matlab puzzle – analysis

Interesting Matlab puzzle

Undocumented plot marker types

Matlab toolstrip – part 9 (popup figures)

Matlab toolstrip – part 8 (galleries)

Matlab toolstrip – part 7 (selection controls)

Matlab toolstrip – part 6 (complex controls)

Matlab toolstrip – part 5 (icons)

Matlab toolstrip – part 4 (control customization)

Reverting axes controls in figure toolbar

Matlab toolstrip – part 3 (basic customization)

Matlab toolstrip – part 2 (ToolGroup App)

Matlab toolstrip – part 1

Categories
  • Desktop (45)
  • Figure window (59)
  • Guest bloggers (65)
  • GUI (165)
  • Handle graphics (84)
  • Hidden property (42)
  • Icons (15)
  • Java (174)
  • Listeners (22)
  • Memory (16)
  • Mex (13)
  • Presumed future risk (394)
    • High risk of breaking in future versions (100)
    • Low risk of breaking in future versions (160)
    • Medium risk of breaking in future versions (136)
  • Public presentation (6)
  • Semi-documented feature (10)
  • Semi-documented function (35)
  • Stock Matlab function (140)
  • Toolbox (10)
  • UI controls (52)
  • Uncategorized (13)
  • Undocumented feature (217)
  • Undocumented function (37)
Tags
ActiveX (6) AppDesigner (9) Callbacks (31) Compiler (10) Desktop (38) Donn Shull (10) Editor (8) Figure (19) FindJObj (27) GUI (141) GUIDE (8) Handle graphics (78) HG2 (34) Hidden property (51) HTML (26) Icons (9) Internal component (39) Java (178) JavaFrame (20) JIDE (19) JMI (8) Listener (17) Malcolm Lidierth (8) MCOS (11) Memory (13) Menubar (9) Mex (14) Optical illusion (11) Performance (78) Profiler (9) Pure Matlab (187) schema (7) schema.class (8) schema.prop (18) Semi-documented feature (6) Semi-documented function (33) Toolbar (14) Toolstrip (13) uicontrol (37) uifigure (8) UIInspect (12) uitools (20) Undocumented feature (187) Undocumented function (37) Undocumented property (20)
Recent Comments
  • Nicholas (4 days 0 hours ago): Hi Yair, Thanks for the reply. I am on Windows 10. I also forgot to mention that this all works wonderfully out of the editor. It only fails once compiled. So, yes, I have tried a...
  • Nicholas (4 days 0 hours ago): Hi Yair, Thanks for the reply. I am on Windows 10. I also forgot to mention that this all works wonderfully out of the editor. It only fails once compiled. So, yes, I have tried a...
  • Yair Altman (4 days 7 hours ago): Nicholas – yes, I used it in a compiled Windows app using R2022b (no update). You didn’t specify the Matlab code location that threw the error so I can’t help...
  • Nicholas (5 days 3 hours ago): Hi Yair, Have you attempted your displayWebPage utility (or the LightweightHelpPanel in general) within a compiled application? It appears to fail in apps derived from both R2022b...
  • João Neves (8 days 8 hours ago): I am on matlab 2021a, this still works: url = struct(struct(struct(struct(hF ig).Controller).PlatformHost). CEF).URL; but the html document is empty. Is there still a way to do...
  • Yair Altman (11 days 6 hours ago): Perhaps the class() function could assist you. Or maybe just wrap different access methods in a try-catch so that if one method fails you could access the data using another...
  • Jeroen Boschma (11 days 9 hours ago): Never mind, the new UI components have an HTML panel available. Works for me…
  • Alexandre (11 days 10 hours ago): Hi, Is there a way to test if data dictionnatry entry are signal, simulink parameters, variables … I need to access their value, but the access method depends on the data...
  • Nicholas (12 days 0 hours ago): In case anyone is looking for more info on the toolbar: I ran into some problems creating a toolbar with the lightweight panel. Previously, the Browser Panel had an addToolbar...
  • Jeroen Boschma (15 days 7 hours ago): I do not seem to get the scrollbars (horizontal…) working in Matlab 2020b. Snippets of init-code (all based on Yair’s snippets on this site) handles.text_explorer...
  • Yair Altman (43 days 9 hours ago): m_map is a mapping tool, not even created by MathWorks and not part of the basic Matlab system. I have no idea why you think that the customizations to the builtin bar function...
  • chengji chen (43 days 16 hours ago): Hi, I have tried the method, but it didn’t work. I plot figure by m_map toolbox, the xticklabel will add to the yticklabel at the left-down corner, so I want to move down...
  • Yair Altman (51 days 9 hours ago): @Alexander – this is correct. Matlab stopped including sqlite4java in R2021b (it was still included in 21a). You can download the open-source sqlite4java project from...
  • Alexander Eder (57 days 4 hours ago): Unfortunately Matlab stopped shipping sqlite4java starting with R2021(b?)
  • K (63 days 15 hours ago): Is there a way to programmatically manage which figure gets placed where? Let’s say I have 5 figures docked, and I split it into 2 x 1, I want to place 3 specific figures on the...
Contact us
Captcha image for Custom Contact Forms plugin. You must type the numbers shown in the image
Undocumented Matlab © 2009 - Yair Altman
This website and Octahedron Ltd. are not affiliated with The MathWorks Inc.; MATLAB® is a registered trademark of The MathWorks Inc.
Scroll to top