How to run som_demo4 in somtoobox? Thank you~
2 views (last 30 days)
Show older comments
Jianshe Feng
on 16 Dec 2015
Commented: Tuan Tran
on 17 Nov 2020
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~
0 Comments
Accepted Answer
Walter Roberson
on 16 Dec 2015
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 Comments
Tuan Tran
on 17 Nov 2020
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
==================================
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!