Too many input arguments error
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
set(get(gca,'children'),'cdata',squeeze(Img(:,:,S,:),ImgSg(:,:,Si,:),ImgCr(:,:,S1,:)))
If I don't put ImgSg(:,:,Si,:),ImgCr(:,:,S1,:) then it's ok. But why are they too many input arguments?
0 Kommentare
Antworten (2)
Jan
am 15 Jan. 2018
Bearbeitet: Jan
am 15 Jan. 2018
The error message concerns squeeze:
A = Img(:,:,S,:)
B = ImgSg(:,:,Si,:);
C = ImgCr(:,:,S1,:);
X = squeeze(A, B, C) % <== 3 inputs, but SQUEEZE takes 1 only
Maybe you want:
squeeze([Img(:,:,S,:), ImgSg(:,:,Si,:), ImgCr(:,:,S1,:)])
or
squeeze(Img(:, :, [S, Si, S1], :))
But then the produced array is 4D and CData is a matrix usually.
0 Kommentare
Rik
am 15 Jan. 2018
I would assume this syntax sets the cdata property of all the children to the same image. If you want to do multiple things, use a loop or repeated code. Or even better: get handles to the objects you are interested in, instead of relying on a specific number and order of children, as this is very prone to change (execution order or another Matlab release).
kids=get(gca,'children');
set(kids(1),'cdata',squeeze(Img(:,:,S,:))
set(kids(2),'cdata',ImgSg(:,:,Si,:))
set(kids(3),'cdata',ImgCr(:,:,S1,:))
0 Kommentare
Siehe auch
Kategorien
Mehr zu Entering Commands 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!