Comments for Undocumented Matlab https://undocumentedmatlab.com Charting Matlab's unsupported hidden underbelly Sat, 23 Jun 2018 03:37:59 +0000 hourly 1 https://wordpress.org/?v=4.4.1 Comment on Plot markers transparency and color gradient by Hassanhttps://undocumentedmatlab.com/blog/plot-markers-transparency-and-color-gradient#comment-430757 Sat, 23 Jun 2018 03:37:59 +0000 http://undocumentedmatlab.com/?p=5262#comment-430757 Hi, I used the suggested script on pc and worked fine. However, when I moved to mac the same script stop working, and I have not transparency gradient. Any help? Thanks,

]]>
Comment on Undocumented feature() function by Walter Robersonhttps://undocumentedmatlab.com/blog/undocumented-feature-function#comment-430555 Fri, 22 Jun 2018 01:31:50 +0000 http://undocumentedmatlab.com/?p=1414#comment-430555
 
  feature('COM_PassSafeArrayByRef', 1)

to turn on passing SAFEARRAY by reference to COM objects.

Described in MATLAB Answers 94888

]]>
Comment on Date selection components by Alexhttps://undocumentedmatlab.com/blog/date-selection-components#comment-430480 Thu, 21 Jun 2018 16:06:05 +0000 http://undocumentedmatlab.com/?p=1684#comment-430480 Thanks so much for your help Yair, code worked perfectly, you’re a life saver.

]]>
Comment on Date selection components by Yair Altmanhttps://undocumentedmatlab.com/blog/date-selection-components#comment-430467 Thu, 21 Jun 2018 13:30:30 +0000 http://undocumentedmatlab.com/?p=1684#comment-430467 @Alex – You can disable certain dates and date-ranges in the calendar as follows:

jDateChooser = javaObjectEDT(com.jidesoft.combobox.DateComboBox);
jDateModel = jDateChooser.getDateModel;
calendar = java.util.Calendar.getInstance;
calendar.setTime(java.util.Date(datestr(startDateNum)));
jDateModel.setMinDate(calendar);  % and similarly for MaxDate

Similarly, you can use jDateModel.addInvalidDate(calendar) to add specific invalid dates within the relevant min/max dates.

You can set the date chooser to have a different initial (default) date value, but the current date is always marked on the calendar and AFAIK this cannot be avoided.

If you’d like any additional assistance with your Matlab project, please contact me by email for a consulting offer.

]]>
Comment on Setting axes tick labels format by Yair Altmanhttps://undocumentedmatlab.com/blog/setting-axes-tick-labels-format#comment-430463 Thu, 21 Jun 2018 13:14:35 +0000 http://undocumentedmatlab.com/?p=2856#comment-430463 @Ron – Tick labels are strings. If you want to use images, then set the ticklabels to empty (i.e., do not show any ticks) and programmatically add images at the relevant [negative] axes locations based on the computed tick positions. You will need to update the images and their location whenever the axes resizes or zooms or pans or changes its ticks in whichever way (details). To be honest, I’m not sure that it’s worth all this effort…

]]>
Comment on Date selection components by Alexhttps://undocumentedmatlab.com/blog/date-selection-components#comment-430357 Wed, 20 Jun 2018 19:30:31 +0000 http://undocumentedmatlab.com/?p=1684#comment-430357 Hi Yair,

I noticed that for the DateComboBox, the current date value was outlined in red (by default) and remained that way even when the selection was changed. Is there any way to move that red outline to another initialized date? Also, I wanted to set a selectable date range, was there any way to do that easily (say by greying out non-valid dates)? Thanks in advance for the help!

]]>
Comment on Setting axes tick labels format by Ron Dekelhttps://undocumentedmatlab.com/blog/setting-axes-tick-labels-format#comment-430324 Wed, 20 Jun 2018 12:43:39 +0000 http://undocumentedmatlab.com/?p=2856#comment-430324 I wonder – is it possible to use images as axis tick labels?
Ron

]]>
Comment on treeTable by Yair Altmanhttps://undocumentedmatlab.com/blog/treetable#comment-430103 Sun, 17 Jun 2018 23:38:22 +0000 http://undocumentedmatlab.com/?p=4062#comment-430103 @Paul – To hide the header row altogether:

jtable.getTableHeader.getParent.setVisible(false)

To disable (but still show) the header:

jtable.getTableHeader.setEnabled(false)
]]>
Comment on ScreenCapture utility by Note: export_fig File Exchange Utility – Nguyen Quan Ba Honghttps://undocumentedmatlab.com/blog/screencapture-utility#comment-429946 Fri, 15 Jun 2018 18:13:24 +0000 http://undocumentedmatlab.com/?p=3059#comment-429946 […] interested in high-fidelity export might also consider using Yair’s ScreenCapture utility. Unlike export_fig, which uses MATLAB’s builtin print function to generate (& fix) the […]

]]>
Comment on Detecting window focus events by Alexander K.https://undocumentedmatlab.com/blog/detecting-window-focus-events#comment-429772 Thu, 14 Jun 2018 05:31:22 +0000 http://undocumentedmatlab.com/?p=584#comment-429772
% R2018a
hFig = figure; 
hAxes = axes(hFig);
plot(rand(100,1),'Parent',hAxes);
 
% JavaSceneServerGLJPanel=get(hAxes.NodeParent.JavaComponent,'Component')
% hJavaSceneServerGLJPanel=handle(JavaSceneServerGLJPanel,'CallbackProperties');
%  
% set(hJavaSceneServerGLJPanel,'FocusGainedCallback',@(x,y)disp('in focus'));
% set(hJavaSceneServerGLJPanel,'FocusLostCallback',  @(x,y)disp('... out'));
 
drawnow
 
jf=get(hFig,'JavaFrame');
jw=handle(jf.getFigurePanelContainer.getTopLevelAncestor,'CallbackProperties');
 
set(jw,'WindowGainedFocusCallback',@(x,y)disp('in focus'));
set(jw,'WindowLostFocusCallback',  @(x,y)disp('... out'));
]]>
Comment on Detecting window focus events by Alexander K.https://undocumentedmatlab.com/blog/detecting-window-focus-events#comment-429736 Thu, 14 Jun 2018 00:52:09 +0000 http://undocumentedmatlab.com/?p=584#comment-429736
% R2018a
hFig = figure; 
hAxes = axes(hFig);
plot(rand(100,1),'Parent',hAxes);
 
JavaSceneServerGLJPanel=get(hAxes.NodeParent.JavaComponent,'Component')
hJavaSceneServerGLJPanel=handle(JavaSceneServerGLJPanel,'CallbackProperties');
 
set(hJavaSceneServerGLJPanel,'FocusGainedCallback',@(x,y)disp('in focus'));
set(hJavaSceneServerGLJPanel,'FocusLostCallback',  @(x,y)disp('... out'));
]]>
Comment on Customizing axes tick labels by Stefanhttps://undocumentedmatlab.com/blog/customizing-axes-tick-labels#comment-429473 Tue, 12 Jun 2018 12:49:44 +0000 https://undocumentedmatlab.com/?p=7304#comment-429473 No, saveas(gcf,'filename.svg') still yields axis ticks not formatted with latex. Or what are you referring to?

]]>
Comment on treeTable by paulhttps://undocumentedmatlab.com/blog/treetable#comment-428849 Thu, 07 Jun 2018 21:05:29 +0000 http://undocumentedmatlab.com/?p=4062#comment-428849 Hi Yair,
This is great GUI table control. Just one question, I try to disable the header, what should I do? Or where can I find relative information about that?

Thanks for your help

Regards,
Paul

]]>
Comment on GUI formatting using HTML by fareedhttps://undocumentedmatlab.com/blog/gui-formatting-using-html#comment-428015 Fri, 01 Jun 2018 14:55:07 +0000 http://undocumentedmatlab.com/?p=6877#comment-428015 Thank you for your reply. You are awesome , have a nice day sir.

]]>
Comment on GUI formatting using HTML by Yair Altmanhttps://undocumentedmatlab.com/blog/gui-formatting-using-html#comment-428011 Fri, 01 Jun 2018 14:40:21 +0000 http://undocumentedmatlab.com/?p=6877#comment-428011 AppDesigner creates figures that do not [currently] support HTML or Java customizations. To use those, you need to use legacy figures using GUIDE or the figure/uicontrol/uitable functions.

]]>
Comment on GUI formatting using HTML by fareedhttps://undocumentedmatlab.com/blog/gui-formatting-using-html#comment-428008 Fri, 01 Jun 2018 14:28:18 +0000 http://undocumentedmatlab.com/?p=6877#comment-428008 I could not display the image in appdesigner uitable. It is a known for this method?

Sorry to ask you this because i have been learning to design gui using appdesigner and testing it ability to run task that i can think of. I am not sure whether the appdesigner is relatively new so it has its limit or i need to start with GUIDE first to fully utilise matlab gui design.

%% This work by showing tables inside a new figure.
pic = fullfile(matlabroot, 'toolbox', 'images', 'icons', 'icon_info.png');
uitable('Data', {['']})
 
% Does not work for uitable in app designer
app.UITable2.Data = ({['']});
]]>
Comment on GUI formatting using HTML by Yair Altmanhttps://undocumentedmatlab.com/blog/gui-formatting-using-html#comment-428003 Fri, 01 Jun 2018 13:46:21 +0000 http://undocumentedmatlab.com/?p=6877#comment-428003 @Fareed – no, it is also possible to use a Java table cell renderer, but this requires knowledge of Java and a deeper use of undocumented aspects (i.e. accessing the uitable’s underlying JTable component, and then setting its column cell renderer accordingly). The HTML method that I described is much simpler to implement, so it is more suitable to the majority of users, but if you know your way around Java then a table cell renderer might well be useful for you.

]]>
Comment on GUI formatting using HTML by Fareedhttps://undocumentedmatlab.com/blog/gui-formatting-using-html#comment-428001 Fri, 01 Jun 2018 13:31:55 +0000 http://undocumentedmatlab.com/?p=6877#comment-428001 Hi Yair,

Is this the only way to display image inside uitable cell? I need to pass an output from imcrop into it. Do i really need to save it as an image file first then call it by the html image linking?

]]>
Comment on Date selection components by Mohammadhttps://undocumentedmatlab.com/blog/date-selection-components#comment-427150 Fri, 25 May 2018 15:09:58 +0000 http://undocumentedmatlab.com/?p=1684#comment-427150 Dear Yair,

Many thanks for your help….

Kind Regards,
Mohammad

]]>
Comment on Auto-completion widget by Yair Altmanhttps://undocumentedmatlab.com/blog/auto-completion-widget#comment-426750 Tue, 22 May 2018 09:22:42 +0000 http://undocumentedmatlab.com/?p=5763#comment-426750 @Peter – My aim in this post, as in my entire blog, is to provide general guidelines, code snippets and sample output. I expect my readers to fill in the missing blanks. Admittedly, not all readers can do this, but I aim high, unapologetically. I rarely spoon-feed users with complete code programs. This would be quite beyond the scope of a typical blog post, or the amount of time that I can spend pro-bono. Remember that this blog has 400 articles, so if I had to spend a full day on each one, this would translate to almost two full work-years!

I have now added some extra code and explanations to the main text, which should be more than enough for most Matlab developers. If it’s still not enough for you, then consider asking a professional Matlab developer to assist you.

]]>