Comments for Undocumented Matlab https://undocumentedmatlab.com/blog_old Charting Matlab's unsupported hidden underbelly Wed, 20 May 2020 03:01:17 +0000 hourly 1 https://wordpress.org/?v=4.4.1 Comment on Uitable sorting by Florianhttps://undocumentedmatlab.com/blog_old/uitable-sorting#comment-510503 Wed, 20 May 2020 03:01:17 +0000 https://undocumentedmatlab.com/?p=2391#comment-510503 Hello Yair thank you for this work.

I am trying to using the sorting function but obviously it treat my ‘double’ as ‘string’. Then the sorting of the numbers is not right.

Any idea how to solve this ?

Thanks,

Flo

]]>
Comment on Sending HTML emails from Matlab by BPolitihttps://undocumentedmatlab.com/blog_old/sending-html-emails-from-matlab#comment-509457 Wed, 27 Nov 2019 11:18:32 +0000 https://undocumentedmatlab.com/?p=6986#comment-509457 Hi,
Thank you for the very nice article! It has helped me a lot and works like a charm :)

One thing with the modified code is that it is necessary to add an attachment to send an HTML format mail (it returns the error “not enough arguments” otherwise).
To change that and be able to send only HTML text, a simple copy of the argument parsing code from the “sendmail” function to the “sendEmail” function works.

Here is the modified code:

function sendEmail(to,subject,theMessage,attachments)
%SENDEMAIL Send e-mail wrapper (with HTML formatting)
% Argument parsing.
  narginchk(2,4);
  if ischar(to)
    to = {to};
  end
  if (nargin < 3)
    theMessage = '';
  end
  if (nargin < 4) 
    attachments = [];
  elseif ischar(attachments)
    attachments = {attachments};
  end
  endmail(to,subject,theMessage,attachments);

I hope it will be useful!

Cheers

]]>
Comment on HTML support in Matlab uicomponents by Martin Lechnerhttps://undocumentedmatlab.com/blog_old/html-support-in-matlab-uicomponents#comment-507214 Wed, 06 Nov 2019 04:26:35 +0000 https://undocumentedmatlab.com/?p=14#comment-507214 For html strings you have to replace the special characters with the entity names (e.g. replace

'<' by '&lt;' or 
'>' by '&gt;'

).
For a description to entity names and a list of the important ones see https://www.w3schools.com/html/html_entities.asp
A full list character entity names can be seen in https://dev.w3.org/html5/html-author/charref.

]]>
Comment on CheckboxList by Arun Joe Josephhttps://undocumentedmatlab.com/blog_old/checkboxlist#comment-507073 Tue, 05 Nov 2019 10:22:55 +0000 https://undocumentedmatlab.com/?p=5012#comment-507073 Is it possible to use this Matlab CheckboxList along with GUIDE? I tried using this in a GUIDE app, and it seems that I cannot pass GUIDE arguments like handles structure to myMatlabCallbackFcn?

Also In myMatlabCallbackFcn, how can I access the Checked Values, as in the names corresponding to the checked values? I tried using jCBList.getCheckedValues, but I am not able to access jCBList inside my callback function.

]]>
Comment on AppDesigner’s mlapp file format by Bradley Stiritzhttps://undocumentedmatlab.com/blog_old/appdesigner-mlapp-file-format#comment-506997 Mon, 04 Nov 2019 23:13:40 +0000 https://undocumentedmatlab.com/?p=6613#comment-506997 It’s great to see that Yair and others are digging into the internals of AppDesigner. It seems to have a lot of promise. At the same time, AppDesigner is still often unstable and unusable, as of R2019b. I just posted on the running Mathworks Answers thread about this–

https://www.mathworks.com/matlabcentral/answers/279042-app-designer-s-editor-is-slow-and-gets-stuck-alot

Question for anyone who has studied the internals– have you also experienced problems in AppDesigner, and then gained any insights whatsoever via your sleuthing? Do you have any clues or hypotheses about what could be going wrong for so many users?

Surely, after all these years of hard work, the AppDesigner team should have worked out most of the minor bugs..?

]]>
Comment on Customizing uifigures part 2 by Vishal Sharmahttps://undocumentedmatlab.com/blog_old/customizing-uifigures-part-2#comment-506840 Mon, 04 Nov 2019 04:22:43 +0000 https://undocumentedmatlab.com/?p=6635#comment-506840 Great help. thanks. I was struggling with Appdesigner, but this post and the links given for mlapp,solved quite a lot of issues.

]]>
Comment on HTML support in Matlab uicomponents by K Xuhttps://undocumentedmatlab.com/blog_old/html-support-in-matlab-uicomponents#comment-506283 Thu, 31 Oct 2019 16:03:55 +0000 https://undocumentedmatlab.com/?p=14#comment-506283 Trouble is, when there are “<" in the string, they are not shown in Matlab! Any ideas to fix it?

]]>
Comment on Setting class property types – take 2 by Martin Lechnerhttps://undocumentedmatlab.com/blog_old/setting-class-property-types-2#comment-506236 Thu, 31 Oct 2019 11:59:04 +0000 https://undocumentedmatlab.com/?p=6390#comment-506236 Hi Kyle,

I normally initialize the property with

properties
    graphicToPrint Graphic = ConcreteGraphic.empty
end

and have no problems with the new syntax.

]]>
Comment on Bold color text in the Command Window by Khaledhttps://undocumentedmatlab.com/blog_old/bold-color-text-in-the-command-window#comment-506138 Wed, 30 Oct 2019 20:04:36 +0000 https://undocumentedmatlab.com/?p=3052#comment-506138 Hello,
I found out how Matlab displays bold hyperlinks. It does so by adding an inline style (style=”font-weight:bold”) inside the <a> tag. For example:

fprintf('\n\t<a href="matlab:doc sin" style="font-weight:bold" rel="nofollow">sin</a>\n\n');
]]>
Comment on Customizing axes part 5 – origin crossover and labels by Rezahttps://undocumentedmatlab.com/blog_old/customizing-axes-part-5-origin-crossover-and-labels#comment-505691 Sun, 27 Oct 2019 19:16:36 +0000 https://undocumentedmatlab.com/?p=6564#comment-505691 Thank you Yair!
In order to analyze the deformation of a surface, I would like to monitor this surface (facade of a building) every 2 hours, for example. so I get every 2 hours a point cloud I have to compare with a reference 3d-surface. How can I represent the distance between the surface and the point cloud as a colored figure?
I couldnt find any method or function in matlab to do that.
do you Any idea to do this?
I would be grateful for a answer, help, ideas or suggestions.

]]>
Comment on Setting class property types – take 2 by Kylehttps://undocumentedmatlab.com/blog_old/setting-class-property-types-2#comment-504995 Wed, 23 Oct 2019 18:25:05 +0000 https://undocumentedmatlab.com/?p=6390#comment-504995 I have serious issues with the new syntax actually. If you want to have abstract classes, the old method would work. The new method does not. For example the below 3 classes work with the old way, but the new way does not. Also sorry for the formatting. I couldn’t seem to indent and add spaces properly

classdef Printer
    properties
       %graphicToPrint Graphic  % doesn't work
        graphicToPrint@Graphic
    end
    methods
        function print(this)
            % do some printing acting on graphicToPrint
            this.graphicToPrint.print();
        end
    end
end
 
classdef Graphic
    methods (Abstract)
        print(this);
    end
end
 
classdef ConcreteGraphic < Graphic
    methods
        function print(this)
            disp('print on ConcreteGraphic happened')
        end
    end
end
 
>> p = Printer;
>> p.graphicToPrint = ConcreteGraphic;
>> p.print
print on ConcreteGraphic happened
]]>
Comment on Customizing axes part 5 – origin crossover and labels by Yair Altmanhttps://undocumentedmatlab.com/blog_old/customizing-axes-part-5-origin-crossover-and-labels#comment-504802 Tue, 22 Oct 2019 14:43:53 +0000 https://undocumentedmatlab.com/?p=6564#comment-504802 Reza – try using the view function.

]]>
Comment on Customizing axes part 5 – origin crossover and labels by Rezahttps://undocumentedmatlab.com/blog_old/customizing-axes-part-5-origin-crossover-and-labels#comment-504797 Tue, 22 Oct 2019 14:08:45 +0000 https://undocumentedmatlab.com/?p=6564#comment-504797 Hi Yair,
Great post. i tried to rotate the axes in a 3d graph in Matlab. but i couldn’t do that. i have two Point Cloud, which i need to calculate the distance between them. As result want to represent it in a Heatmap with a coded Colormap. My project have Orientation according to the global cartesian coordinate system (measured with Totalstation scanner). I monitor facade of a Building (detect Moving in x,z plane). I want to change the Orientation of my Point cloud along x, y and z to have a good front view of the Project (not distorted). how can i rotate the Axes suitable to my project? Thanks for your help.

]]>
Comment on Advanced JIDE Property Grids by Yair Altmanhttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-504659 Mon, 21 Oct 2019 17:21:18 +0000 https://undocumentedmatlab.com/?p=1316#comment-504659 Philip – you cannot directly use a Java control inside Java tables, such as a Property Grid. Inside a table you should use a Cell-Editor and Cell-Renderer. Showing how to integrate them inside a JIDE Property Grid is well outside the scope of this blog. You can search in Java forums, or the code within my propertiesGUI utility.

A description of how to integrate color cell renderers and editors in Java-based Matlab uitables can be found in my uitable customization report (note: this is related, but not directly applicable, to property-grids).

]]>
Comment on Advanced JIDE Property Grids by Philiphttps://undocumentedmatlab.com/blog_old/advanced-jide-property-grids#comment-504592 Mon, 21 Oct 2019 06:09:43 +0000 https://undocumentedmatlab.com/?p=1316#comment-504592 Yair,

Could you please shed some more insight on how to use color choosers (specifically the ColorComboBox / JideColorSplitButton / or com.mathworks.mlwidgets.graphics.ColorPicker) in JIDE Property Grids? I’ve been referencing the notes you outlined in this post as well as the following two posts on your undocumented site ( https://undocumentedmatlab.com/blog/color-selection-components and https://undocumentedmatlab.com/using-jide-combo-boxes ), however my efforts to insert the component into the grid were unsuccessful.

]]>
Comment on uicontextmenu performance by E Zapatohttps://undocumentedmatlab.com/blog_old/uicontextmenu-performance#comment-503986 Fri, 18 Oct 2019 15:40:16 +0000 https://undocumentedmatlab.com/?p=4751#comment-503986 Niko,

I know this was years ago and you’ve almost certainly resolved this, but you can get the calling object via the figure’s CurrentObject property. So from the callback:

get(ancestor(src, 'figure'), 'CurrentObject')

This answer really came from MVP Jan:
https://www.mathworks.com/matlabcentral/answers/67685-how-do-i-find-out-which-uicontrol-launched-my-context-menu

]]>
Comment on Customizing contour plots part 2 by Indira Xhttps://undocumentedmatlab.com/blog_old/customizing-contour-plots-part-2#comment-502483 Thu, 10 Oct 2019 07:29:28 +0000 https://undocumentedmatlab.com/?p=6304#comment-502483 Hello,
I use “surf” with x and y as vectors, and z as matrix. I want to move the contours at 59.7 in z, so I wrote this:

handles = meshc(z);
hContour = handles(2);
hContour.ContourZLevel = 59.5;

I don’t see the contours, instead I see a small “bar” along z axis.

May you please give me a hint?

Thanks in advance.

]]>
Comment on Matlab callbacks for uifigure JavaScript events by Manuhttps://undocumentedmatlab.com/blog_old/matlab-callbacks-for-uifigure-javascript-events#comment-501509 Fri, 04 Oct 2019 16:26:27 +0000 https://undocumentedmatlab.com/?p=7913#comment-501509 Hi,

thanks very much for this code. Working perfectly for me on a uiimage object which I use to display a tiled map (like OpenStreetMap).
Since I needed more possible interactions than just the default MATLAB “ImageClicked” callback, this came as the perfect solution!

Thanks again, great work.

]]>
Comment on Matlab toolstrip – part 9 (popup figures) by alain barraudhttps://undocumentedmatlab.com/blog_old/matlab-toolstrip-part-9-popup-figures#comment-501126 Wed, 02 Oct 2019 08:52:13 +0000 https://undocumentedmatlab.com/?p=8402#comment-501126 Hi yair,
I have tested your miniserie. All works fine with R2019b except some built in demos (as noted by many users) which require older releases.
You say that toolstrip can be also attached to figure and uifigure. What is the equivalent of
hToolGroup.addTabGroup(hTabGroup) for these windows container?

We are all impatient to read the future “part 10”.

Best regards
Alain

]]>
Comment on Controlling plot data-tips by Leandro de Oliveirahttps://undocumentedmatlab.com/blog_old/controlling-plot-data-tips#comment-501050 Tue, 01 Oct 2019 22:17:26 +0000 https://undocumentedmatlab.com/?p=2432#comment-501050 My contribuition to create new datatip

clc
clear all
close all
 
x = 0:0.1:10;
y = sin(x);
 
h = figure(1);
hObj = plot(x,y);
index = [25 75 100];
hold on
for i = 1:3
    cursorMode = datacursormode(h);
    hDatatip = cursorMode.createDatatip(hObj);
    pos = [x(index(i)) y(index(i))];
    set(get(hDatatip,'DataCursor'), 'DataIndex',index(i), 'TargetPoint',pos);
    set(hDatatip, 'Position', pos);
    updateDataCursors(cursorMode);
end
hold off
]]>