How to run som_demo4 in somtoobox? Thank you~

5 次查看(过去 30 天)
Hi guys, I am learning SOM these days, when I run som_demo4.m in somtoolbox downloaded from http://www.cis.hut.fi/somtoolbox/, MATLAB showed that:"
Cannot convert double value -1 to a handle
Error in som_show (line 497) h_colorbar(i,1)=-1;
Error in som_demo4 (line 40) som_show(sM,'umat','all','comp',[1:4],'empty','Labels','norm','d');"
Is there anybody can help me fix this? I am using MATLAB 2015 under Win10. Thank you~

采纳的回答

Walter Roberson
Walter Roberson 2015-12-16
The code is designed for MATLAB R2014a or earlier in which handles were represented as floating point numbers.
You could change that line to
h_colorbar(i,1) = gobjects(1,1);
to get a GraphicsPlaceholder . However there is very likely some other code somewhere in the toolbox that is checking for that negative value. Those tests should be replaced with isgraphics() tests... if you can find the locations.
  2 个评论
Jianshe Feng
Jianshe Feng 2015-12-17
Thank you for your helpful answer. I commented the original line and add the new one and it works.
Tuan Tran
Tuan Tran 2020-11-17
Hi every one,
How can I fix these errors. I am using Matlab 2018b.
================================
som_show(sM,'norm','n');
Error using axes
Handles of type ColorBar cannot be made the current Axes.
Error in som_recolorbar (line 300)
mem_axes=gca; axes(h_(i));
Error in som_show (line 523)
h_colorbar=som_recolorbar('all', 3, General.scale);
%refresh colorbars
==================================

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by