% updaten.m % % n is the integer such that n>=1 n=fix(n); if (n<1), n=1; end; % l is the integer such that 0<=ln-1), l=n-1; end; % Activate Control figure figure(F2); % Setting the sliders labels and positions to n and l set(n_text,'string',[ 'n=' num2str(n)]); drawnow; set(l_text,'string',[ 'l=' num2str(l)]); drawnow; set(n_slide,'value',n);drawnow; set(l_slide,'value',l); drawnow; % Recalculate data only if it is necessary if (n ~= nold) figure(F1); set(mess1,'visible','on');drawnow; expr = radhyd(n,l,'x');nold=n; figure(F1); set(mess1,'visible','off');drawnow; % Make full function comnd=[ 'y=' expr ';']; % Change the ordinary matrix operations into array operations comnd=strrep(comnd,'^','.^'); comnd=strrep(comnd,'*','.*'); comnd=strrep(comnd,'/','./'); end eval(comnd); % Plot in any case if Rmulv==-1 figure(F1); plot(x,y,[0 range], [0 0]); else figure(F1); plot(x,x.*y,[0 range], [0 0]); end figure(F1); title([ 'n=' num2str(n) ', l=' num2str(l) ]);