Borrar filtros
Borrar filtros

How to run som_demo4 in somtoobox? Thank you~

5 visualizaciones (últimos 30 días)
Jianshe Feng
Jianshe Feng el 16 de Dic. de 2015
Comentada: Tuan Tran el 17 de Nov. de 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~

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by