Comments for Undocumented Matlab http://undocumentedmatlab.com Charting Matlab's unsupported hidden underbelly Thu, 20 Jul 2017 09:26:19 +0000 hourly 1 https://wordpress.org/?v=4.4.1 Comment on Customizing menu items part 3 by Yair Altmanhttp://undocumentedmatlab.com/blog/customizing-menu-items-part-3#comment-410556 Thu, 20 Jul 2017 09:26:19 +0000 http://undocumentedmatlab.com/?p=2909#comment-410556 @Sneha – as I explained here, the menu needs to be opened once in order for its menu items to become visible.

]]>
Comment on Customizing menu items part 3 by Snehahttp://undocumentedmatlab.com/blog/customizing-menu-items-part-3#comment-410555 Thu, 20 Jul 2017 09:11:38 +0000 http://undocumentedmatlab.com/?p=2909#comment-410555 Hi Yair,
The article is very helpful.
I tried to execute the commands in a single m-file programatically but got an error.
The error occurred was

Java exception occurred:
java.lang.ArrayIndexOutOfBoundsException: No such child: 0
	at java.awt.Container.getComponent(Unknown Source)
	at javax.swing.JMenu.getMenuComponent(Unknown Source)

if I execute the code one line at a time I did not face any issue .
Could you please help me with the issue

]]>
Comment on TODO by Yair Altmanhttp://undocumentedmatlab.com/about/todo#comment-410544 Thu, 20 Jul 2017 06:30:30 +0000 http://undocumentedmatlab.com/?page_id=59#comment-410544 Try it in R2017b :-)

]]>
Comment on Customizing Matlab uipanels by OrOhttp://undocumentedmatlab.com/blog/customizing-matlab-uipanels#comment-410531 Thu, 20 Jul 2017 01:56:09 +0000 http://undocumentedmatlab.com/?p=5595#comment-410531 It helps a lot. Thank you !
Does it work in MATLAB Compiler ? I do not see a reason why it should not but I would like to have your confirmation.

]]>
Comment on TODO by D Brienhttp://undocumentedmatlab.com/about/todo#comment-410518 Wed, 19 Jul 2017 22:24:49 +0000 http://undocumentedmatlab.com/?page_id=59#comment-410518 I am experimenting with this now. You need to change your java version to 1.8+, which requires setting the environment variable. It doesn’t appear that this breaks anything as far as I’ve seen, but officially even MATLAB 2017a still is on 1.7, which is too bad. You will also need to set up your static classpath to include the jfxrt.jar and any custom functions you will end up using.

From there a JFXPanel will initialize the JavaFX toolkit and you can add a scene and all of the JavaFx functions work fine. You will need to use Yair’s method for sending event notices if you wish to communicate with MATLAB. This is nice though because you can actually use css to skin the look of the GUI. It seems like possible the best option for creating fully customizable GUIs in MATLAB.

The set up is the biggest pain I’ve found is the set up and changing the native java version. Not all clients will want to do that.

]]>
Comment on Real-time trading system demo by Leonelhttp://undocumentedmatlab.com/ib-matlab/real-time-trading-system-demo#comment-410447 Tue, 18 Jul 2017 19:13:23 +0000 http://undocumentedmatlab.com/?page_id=3963#comment-410447 Hi Yair,
Could you please contact me, I have a question regarding a similar application

Regards

Leonel

]]>
Comment on User-defined tab completions – take 2 by Sky Sartoriushttp://undocumentedmatlab.com/blog/user-defined-tab-completions-take-2#comment-410354 Sun, 16 Jul 2017 22:00:11 +0000 http://undocumentedmatlab.com/?p=6961#comment-410354 This is a post I have been waiting for, Yair. Thank you. I was spending too much time digging through the Matlab functionSignatures.json files to find examples similar to what I was trying to do, so this summary is an excellent resource.

]]>
Comment on Images in Matlab uicontrols & labels by Yair Altmanhttp://undocumentedmatlab.com/blog/images-in-matlab-uicontrols-and-labels#comment-410342 Sun, 16 Jul 2017 16:27:39 +0000 http://undocumentedmatlab.com/?p=3177#comment-410342 @Ronit – you can update the button’s CData property. Read the Matlab documentation for the uicontrol function for details/examples.

]]>
Comment on Images in Matlab uicontrols & labels by Ronithttp://undocumentedmatlab.com/blog/images-in-matlab-uicontrols-and-labels#comment-410312 Sun, 16 Jul 2017 07:39:00 +0000 http://undocumentedmatlab.com/?p=3177#comment-410312 Do you know a way to show images on push buttons via GUIDE?
Thanks in advance!

]]>
Comment on Waiting for asynchronous events by Brianhttp://undocumentedmatlab.com/blog/waiting-for-asynchronous-events#comment-410305 Sun, 16 Jul 2017 04:10:39 +0000 http://undocumentedmatlab.com/?p=3017#comment-410305 Hey I know this is a rather old post, but I wanted to post my solution just in case anyone from the future has the same question. It turns out you can call back into Matlab via JMI to poll the keyboard event queue and trigger an exception if a “Ctrl-C” is waiting. I wrote this up in more detail on my blog at https://v1ntage.io/2017/07/01/episode-001-handling-matlab-interrupts-in-java/. Let me know what you think.

]]>
Comment on The javacomponent function by Yair Altmanhttp://undocumentedmatlab.com/blog/javacomponent#comment-410287 Sat, 15 Jul 2017 21:16:25 +0000 http://undocumentedmatlab.com/?p=1793#comment-410287 @Anu – this sounds like a bug in your code. Errors are not supposed to happen.

]]>
Comment on Customizing contour plots part 2 by Yair Altmanhttp://undocumentedmatlab.com/blog/customizing-contour-plots-part-2#comment-410285 Sat, 15 Jul 2017 21:13:27 +0000 http://undocumentedmatlab.com/?p=6304#comment-410285 @Ricardo – I don’t quite understand what you need. In general, if you want to change the action of the slider then simply update its callback function:

cbFunc = @(hSlider,evtData) set(hContour,'ContourZLevel',hSlider.getValue/100*zrange+zmin);
]]>
Comment on User-defined tab completions – take 2 by Greghttp://undocumentedmatlab.com/blog/user-defined-tab-completions-take-2#comment-410176 Thu, 13 Jul 2017 16:48:09 +0000 http://undocumentedmatlab.com/?p=6961#comment-410176 Thanks, Yair, this is awesome!

One added detail that I discovered when implementing this feature this morning is where MATLAB expects the .json file and the appropriate syntax for functions in package folders (i.e. +directories).

It looks like the appropriate thing is to place the .json file in the root of the package (the folder above the top-level +folder) and then reference the function names with their full package-specific function name. As an example, check out the functionSignatures.json file in %matlabroot/toolbox/shared/io/, which contains signatures for functions like matlab.io.TextVariableImportOptions.

By contrast, class methods seem to get referenced just by their method names, though class methods in @-folders are still described in the higher-level .json file. For example, in %matlabroot/toolbox/matlab/datatypes/functionSignatures.json, the method “histogram” of the categorical class is referenced simply as “histogram,” even though is a regular (non-static) method stored in the @categorical folder.

]]>
Comment on User-defined tab completions – take 2 by Yair Altmanhttp://undocumentedmatlab.com/blog/user-defined-tab-completions-take-2#comment-410172 Thu, 13 Jul 2017 16:33:56 +0000 http://undocumentedmatlab.com/?p=6961#comment-410172 @Heiko – nice catch about the comments! Apparently functionSignatures.json is not a strictly-compliant JSON file, and undergoes some pre-processing by the Matlab engine.

]]>
Comment on User-defined tab completions – take 2 by Heikohttp://undocumentedmatlab.com/blog/user-defined-tab-completions-take-2#comment-410166 Thu, 13 Jul 2017 14:50:35 +0000 http://undocumentedmatlab.com/?p=6961#comment-410166 Very nice! I’ve been waiting for a feature like this since we offered our toolbox. Especially the possibility to let MatLab determine the choices is gold. Even though it seems to depend on the type. I could not yet get it to accept other choices than a cell array. Looking forward to somebody taking the time to document a more or less complete list of options for each parameter…

About JSON comments: doing my first steps in ML R2016b I found that comments are possible. ML accidently opened the json file “R2016b\toolbox\matlab\graph2d\functionSignatures.json” which contained C-like inline comments starting with “//”. I also tried “/* */” comments successfully.

Thanks for the very useful help!!
Heiko

]]>
Comment on General-use object copy by Yair Altmanhttp://undocumentedmatlab.com/blog/general-use-object-copy#comment-409935 Sat, 08 Jul 2017 17:53:34 +0000 http://undocumentedmatlab.com/?p=5782#comment-409935 @Scott – nice idea!
Thanks for sharing

]]>
Comment on General-use object copy by Scott Kochhttp://undocumentedmatlab.com/blog/general-use-object-copy#comment-409881 Fri, 07 Jul 2017 18:15:43 +0000 http://undocumentedmatlab.com/?p=5782#comment-409881 Hi Bill – You might try creating a simple wrapper class to hold your old object. It’s a little hacky but seemed to work for me.

classdef wrapper
   properties
      oldobj
   end
end

Then use the property to store your old object:

a = wrapper;
a.oldobj = oldobject;
b = getByteStreamFromArray(a);
c = getArrayFromByteStream(b);
c.oldobj
]]>
Comment on The javacomponent function by Anuhttp://undocumentedmatlab.com/blog/javacomponent#comment-409852 Fri, 07 Jul 2017 06:43:59 +0000 http://undocumentedmatlab.com/?p=1793#comment-409852 hello sir,
I have created a 2 tabgroups in my GUI.At first it is good but after adding uicontrols to those tabs using different panels i am getting errors and automatically a new hgjavacomponent is being added to GUI everytime i run the GUI. This results in abnormal behaviour of the GUI. How can i stop those hgjavacomponents visibility?

]]>
Comment on Simple GUI Tabs for Advanced Matlab Trading App by Negshttp://undocumentedmatlab.com/blog/simple-gui-tabs-for-advanced-matlab-trading-app#comment-409830 Thu, 06 Jul 2017 21:32:38 +0000 http://undocumentedmatlab.com/?p=6275#comment-409830 Yair, Thanks for the reply. You are right, sorry I meant .m (and not .mat). No, Actually I passed the hObject and eventData correctly, but my problem was that I was using a slightly wrong syntax when setting the callback property of my object (object X). I could finally fix it by using the below syntax and now it works.

set(handles.ObjX,'Callback',@(hObject,eventdata)ObjX_Callback(hObject,eventdata,handles));

Thanks again for your time and the great tool!

]]>
Comment on Images in Matlab uicontrols & labels by Yair Altmanhttp://undocumentedmatlab.com/blog/images-in-matlab-uicontrols-and-labels#comment-409805 Thu, 06 Jul 2017 12:11:18 +0000 http://undocumentedmatlab.com/?p=3177#comment-409805 @Klaus – not directly, but you can create a small image and add it to the button’s CData. As long as you don’t resize the button too much in either direction, this should work nicely.

]]>