Comments for Undocumented Matlab http://undocumentedmatlab.com Charting Matlab's unsupported hidden underbelly Fri, 18 Aug 2017 20:57:49 +0000 hourly 1 https://wordpress.org/?v=4.4.1 Comment on Bar plot customizations by dgmhttp://undocumentedmatlab.com/blog/bar-plot-customizations#comment-412166 Fri, 18 Aug 2017 20:57:49 +0000 http://undocumentedmatlab.com/?p=4828#comment-412166 Thanks for this solution. In addition to needing to label the individual bars, I have floating point numbers as the labels at the tops of the bars. Is there a way to center those labels over the bars instead of starting the text at the mid-point of each bar?

]]>
Comment on General-use object copy by Mario Koddenbrockhttp://undocumentedmatlab.com/blog/general-use-object-copy#comment-412009 Wed, 16 Aug 2017 10:44:38 +0000 http://undocumentedmatlab.com/?p=5782#comment-412009 Thanks for your fast reply @Yair.

I’m really just trying to copy an object inside my workspace. There is no file IO involved…

]]>
Comment on General-use object copy by Yair Altmanhttp://undocumentedmatlab.com/blog/general-use-object-copy#comment-412003 Wed, 16 Aug 2017 09:45:51 +0000 http://undocumentedmatlab.com/?p=5782#comment-412003 @Mario – I suspect that you are trying to move data between different computer types and/or different Matlab releases, and this is apparently not supported.

]]>
Comment on General-use object copy by Mario Koddenbrockhttp://undocumentedmatlab.com/blog/general-use-object-copy#comment-412002 Wed, 16 Aug 2017 09:41:12 +0000 http://undocumentedmatlab.com/?p=5782#comment-412002 Hi Yair,

from time to time I get the following error:

"Error using getArrayFromByteStream
Unable to read data stream because the data contains a bad version or endian-key"

It seems not to be reproducable.
Do you know reasons or fixes for that?

Best regards,
Mario

]]>
Comment on Sending email/text messages from Matlab by Yair Altmanhttp://undocumentedmatlab.com/blog/sending-email-text-messages-from-matlab#comment-411884 Sun, 13 Aug 2017 10:08:22 +0000 http://undocumentedmatlab.com/?p=6765#comment-411884 @Muhammad – you can use this feature to send text messages as long as your phone operator supports an email-to-text feature. You need to contact your operator to find out the specific details.

As far as I know WhatsApp does not enable outside programs to communicate with it, and has no plans to do so in the near future.

]]>
Comment on Sending email/text messages from Matlab by Muhammad Abdurrehmanhttp://undocumentedmatlab.com/blog/sending-email-text-messages-from-matlab#comment-411883 Sun, 13 Aug 2017 09:58:13 +0000 http://undocumentedmatlab.com/?p=6765#comment-411883 Could this function (Sending Text Messages) useful outside USA?

Secondly Is there any possibility available to communicate with WhatsApp via Matlab

Thanks

]]>
Comment on Editable combo-box by Yair Altmanhttp://undocumentedmatlab.com/blog/editable-combo-box#comment-411853 Sat, 12 Aug 2017 17:44:39 +0000 http://undocumentedmatlab.com/?p=4246#comment-411853 @Eric – you can integrate a com.jidesoft.combobox.MultiSelectListComboBox or MultilineStringComboBox. If you need consulting assistance, contact me by email.

]]>
Comment on Aligning uicontrol contents by Yair Altmanhttp://undocumentedmatlab.com/blog/aligning-uicontrol-contents#comment-411851 Sat, 12 Aug 2017 17:37:57 +0000 http://undocumentedmatlab.com/?p=6663#comment-411851 @Les – HTML formatting is more CPU and memory-intensive, while being less powerful, than using Cell Renderers (details). Also, whenever you update an HTML-formatted cell, you’d see the full HTML string as the text in the cell content, which is a bit awkward. Also, if you try to get the values in the table, you’d need to parse out the HTML tags.

However, there is no dispute that HTML formatting is super-easy to use, and in many cases the drawbacks listed above pale in comparison to the simplicity and usefulness of HTML formatting. So in general I use HTML formatting for most simple formatting, and I only use Cell Renderers for large tables (with numerous formatted cells), when the formatting is not easy to achieve with HTML, and/or when the table cells need to be updated by the user.

]]>
Comment on Aligning uicontrol contents by Les Beckhamhttp://undocumentedmatlab.com/blog/aligning-uicontrol-contents#comment-411822 Sat, 12 Aug 2017 03:01:06 +0000 http://undocumentedmatlab.com/?p=6663#comment-411822 Interesting post, as always.

I’m curious why you state that “HTML formatting is generally frowned-upon compared to the alternatives”. By whom? And why?

Perhaps you can elaborate.

Thank you

]]>
Comment on Editable combo-box by Erichttp://undocumentedmatlab.com/blog/editable-combo-box#comment-411798 Fri, 11 Aug 2017 17:31:49 +0000 http://undocumentedmatlab.com/?p=4246#comment-411798 I created a plotter using three popup menus: one for X-variable, one for Y, and one for a figure name. When a figure name (number) is selected, its callback function grabs strings from X and Y popup menus, search these from a loaded dataset, and plots them.

What I want to do is multiple-selection on a popup menu. I researched quite a bit and learned that popup menu doesn’t have that capability as you also mentioned on the top in the regular documented way.

The reason why I don’t want and almost can’t use list box is my GUI has many panels from top to bottom; each containing the three popup menus mentioned above. Each panel represents one dataset. This means if I select and load ten .MAT files, a GUI will be created with 10 panels from top to bottom. Each dataset can have as many as 100 or more variables. Unless I completely scrub the current GUI generation code, listbox won’t work. Say each listbox shows ten variables and a scroll bar. The height of it and some margins above and below times 10 will create a gigantic GUI that will be basically unusable.

Do you know a work-around? Thank you in advance.

]]>
Comment on A few parfor tips by William Smithhttp://undocumentedmatlab.com/blog/a-few-parfor-tips#comment-411627 Tue, 08 Aug 2017 07:18:44 +0000 http://undocumentedmatlab.com/?p=6516#comment-411627 If you have heterogenous workloads, i.e. some of the parfor tasks are quick and some are slow, and they are clustered together, e.g. the slow ones are at the start, try putting your work into an array, then randomizing the array:

irand = randperm(numel(work));
work = work(irand);

If you have *very* heterogeneous workloads, such that some of the parfor elements will take a long time, and some will be ‘0 work’, it may be more efficient to compute which elements have ‘0 work’ beforehand and remove these elements from the work. Otherwise the very heterogeneous workloads won’t balance well across the cores, and you may well be left with a few cores running long running tasks, while the others have completed.

]]>
Comment on GUI automation using a Robot by Mayankhttp://undocumentedmatlab.com/blog/gui-automation-robot#comment-411492 Sat, 05 Aug 2017 13:01:00 +0000 http://undocumentedmatlab.com/?p=1815#comment-411492 create an int[] array for all the KeyEvent.Vk_1 to ..last then use the for loop to iterate over the same.

]]>
Comment on Afterthoughts on implicit expansion by Sue Ann Koayhttp://undocumentedmatlab.com/blog/afterthoughts-on-implicit-expansion#comment-411438 Fri, 04 Aug 2017 01:37:22 +0000 http://undocumentedmatlab.com/?p=6750#comment-411438 Having only recently installed Matlab 2017a, I almost immediately “discovered” this feature and am compelled to say that implicit expansion gives me the creeps. As an outside example: why do some languages like C++ impose type safety? It’s not because programmers can’t write their own type checking code. For a 10-line function I can easily write 50 lines of code to perform every possible check I can think of to ensure that the inputs are of the correct type and sizes and ranges and whatnot. Will this make me a better coder? Maybe. Will chances be high that I’ll do it for every function? If I existed solely for such a purpose, maybe. Will this help others read and modify my code down the line? Well…

As a person from a joint CS/science background, I’m certainly not advocating sloppy coding practices. I think implicit expansion (and yes also lack of type safety) actually goes towards encouraging sloppy coding practices. Now instead of a self-documenting piece of code where one uses bsxfun(), if I read the line a .* b somewhere I have to wonder if it is the outer product of vectors or an element-wise product or anything goes. The best designed systems limit the amount of mistakes that humans can make, and allowing the syntax itself to be sloppy doesn’t seem very encouraging.

]]>
Comment on User-defined tab completions – take 2 by Sky Sartoriushttp://undocumentedmatlab.com/blog/user-defined-tab-completions-take-2#comment-410907 Thu, 27 Jul 2017 01:43:52 +0000 http://undocumentedmatlab.com/?p=6961#comment-410907 I have been encountering some interesting behavior in 2017b. Signatures that were working in 2017a now do not, though the error message does look like it is trying to be helpful: “Unable to load signatures for 'foo'. 'namevalue' and 'flag' arguments may not appear both inside and outside of groups.” So, it appears that this is a new “rule” for signatures (and violating the rule was giving me the desired behavior before).

TMW seems to get around this (see signatures for e.g. join) by putting a copy of each ‘outside’ arguments in every member of an existing MEG. Another workaround that seems to work is to put each ‘outside’ argument in its own (lonely) MEG, which has the benefit of avoiding duplicates.

]]>
Comment on Customizing menu items part 3 by Snehahttp://undocumentedmatlab.com/blog/customizing-menu-items-part-3#comment-410878 Wed, 26 Jul 2017 11:23:51 +0000 http://undocumentedmatlab.com/?p=2909#comment-410878 Hi Yair,
Apologies for my late reply. I did not attach the code previously sorry for that
The below is the code written
jf = get(hObject,’JavaFrame’);
jmb = jf.fHG2Client.getMenuBar;
jFileMenu = jmb.getComponent(0);
jFileMenu.doClick; %% open menu
jFileMenu.doClick; % close the menu
jvalue1 = jFileMenu.getMenuComponent(0);
jvalue2=jFileMenu.getMenuComponent(1);
jvalue3 = jFileMenu.getMenuComponent(2);

So this code if I execute line by line I am able to get tool tip messages but i run code as a .m file I gt that error

]]>
Comment on Customizing Workspace context-menu by Lexhttp://undocumentedmatlab.com/blog/customizing-workspace-context-menu#comment-410870 Wed, 26 Jul 2017 07:16:41 +0000 http://undocumentedmatlab.com/?p=1943#comment-410870 Thank you, Yair! I use Matlab 2017a and make menu for Java class ‘java.lang.Object’. But this menu item appears only for this class and don’t take inheritance into account. Can I make menu item for all Java variables?

]]>
Comment on Plot line transparency and color gradient by Yair Altmanhttp://undocumentedmatlab.com/blog/plot-line-transparency-and-color-gradient#comment-410806 Tue, 25 Jul 2017 01:20:41 +0000 http://undocumentedmatlab.com/?p=5200#comment-410806 I don’t think the lines will look disjointed if you ensure that the endpoints are exactly the same.

]]>
Comment on Plot line transparency and color gradient by Vlad Atanasiuhttp://undocumentedmatlab.com/blog/plot-line-transparency-and-color-gradient#comment-410793 Mon, 24 Jul 2017 21:12:37 +0000 http://undocumentedmatlab.com/?p=5200#comment-410793 Correct, Yair. But you will have problems where lines meet: their extremities will look disjoined.

]]>
Comment on Plot line transparency and color gradient by Yair Altmanhttp://undocumentedmatlab.com/blog/plot-line-transparency-and-color-gradient#comment-410719 Sun, 23 Jul 2017 05:20:42 +0000 http://undocumentedmatlab.com/?p=5200#comment-410719 @Vlad – I am not aware of an outline property, but you should be able to replicate it by using two overlapping lines that have different colors/transparency levels, one line slightly wider than the other.

]]>
Comment on Plot line transparency and color gradient by Vlad Atanasiuhttp://undocumentedmatlab.com/blog/plot-line-transparency-and-color-gradient#comment-410718 Sun, 23 Jul 2017 04:32:21 +0000 http://undocumentedmatlab.com/?p=5200#comment-410718 Hello Yair,

Do you known if there is an “outline.Color” property for the “line” object? It would make 3D objects much more readable in terms of what is front and what is back (get rid of the Necker illusion). See, e.g., https://en.wikipedia.org/wiki/File:4Asterane.png

Thanks!

]]>