Error in livescript with the clustergram function

2 次查看(过去 30 天)
Dear all,
I am trying to compile a livescript report with my data but I am stuck on the clustergram function. Whenever I try to run the livescript section (CTRL+ENTER) I get the following error:
Error using uimenu
First argument must be a valid parent, such as a Figure or Panel object.
Error in clustergram/view>updateUIMenus (line 149)
uimenu(hw ,'Label','Print to Figure',...
Error in clustergram/view (line 61)
updateUIMenus(obj);
Error in clustergram (line 414)
obj.view;
Here is a piece of code to reproduce in Matlab 2017a and 2017b: Create a live script and press CTRL+ENTER:
cgo_J = clustergram(rand(10))
Any help or workaround would be appreciated!
Tamara

采纳的回答

Arthur Goldsipe
Arthur Goldsipe 2017-9-25
I believe clustergram needs to be updated to work properly in Live Scripts (MLX files). One workaround is to use a regular script (M file) instead. You can still create a report by publishing your script.
Alternatively, if you really want to use clustergram in a Live Script, you will need to prevent the calls to uimenu. One way to do that would be to "hide" the builtin uimenu function by replacing it with something like the following function:
function menu = uimenu(parent, varargin)
if isa(parent, 'matlab.graphics.Graphics') && (isempty(parent) || strcmp(parent.Tag, 'Clustergram'))
menu = [];
else
menu = builtin('uimenu', parent, varargin{:});
end
if nargout == 0
clear menu
end
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Repeated Measures and MANOVA 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by