I have a struct file: x.head = imread ('brain.jpg'); whos x
I have a slider:
G3.slide = uicontrol('style','slide',...
'unit','pix',...
'position',[400 280 120 30],...
'min',-10,'max',10,'val',1,...
'sliderstep',[1/20 1/10],...
'callback',{@sl_call3,G3});
calling the function:
function [] = sl_call(varargin)
% Callback for the slider.
[k,x] = varargin{[1,3]};
set(x.head,x.head*get(k,'value'))
But when I squeeze, I get the error:
Reference to non-existent field 'head'. Error in Project / sl_call (line 87) set (x.head, x.head * get (k, 'value')) Error while evaluating UIControl Callback