Error using handle.handle/set

조회 수: 4 (최근 30일)
Jose Luis
Jose Luis 2014년 6월 16일
답변: Jos (10584) 2014년 6월 16일
Hello, I would like to know while when executing this code:
N=4; % # of data types, hence legend entries
Data = randi(N,30,30); % generate fake data
imagesc(Data) % image it
cmap = jet(N); % assigen colormap
colormap(cmap)
hold on
L = line(ones(N),ones(N)); % generate line
set(L,{'color'},mat2cell(cmap,ones(1,N),3)); % set the colors according to cmap
legend('A','B','C','D') % add as many legend entries as data
I obtain de following error:
Error using handle.handle/set Invalid or deleted object.
Error in test (line 8) set(L,{'color'},mat2cell(cmap,ones(1,N),3)); % set the colors according to cmap
Thank you for your help

답변 (1개)

Jos (10584)
Jos (10584) 2014년 6월 16일
Your does work properly here (although it doesn't show anything useful …)
Did you try to use the debugger? What is the contents of L when the error occurs?

카테고리

Help CenterFile Exchange에서 Vector Spaces and Subspaces에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by