필터 지우기
필터 지우기

How to run som_demo4 in somtoobox? Thank you~

조회 수: 5 (최근 30일)
Jianshe Feng
Jianshe Feng 2015년 12월 16일
댓글: Tuan Tran 2020년 11월 17일
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