How to run som_demo4 in somtoobox? Thank you~

1 Ansicht (letzte 30 Tage)
Jianshe Feng
Jianshe Feng am 16 Dez. 2015
Kommentiert: Tuan Tran am 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~

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 16 Dez. 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 Kommentare
Jianshe Feng
Jianshe Feng am 17 Dez. 2015
Thank you for your helpful answer. I commented the original line and add the new one and it works.
Tuan Tran
Tuan Tran am 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
==================================

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by