
tic
ao=analogoutput('nidaq')
addchannel(ao, 0);
ch0=ao.Channel
% frequency  = 500;
% amplitude  = 5;
offset     = 0;
% dutycycle  = 50;
sampleRate=10000;
set(ao,'SampleRate',sampleRate);

%------------------------------------------------------


set(ao, 'TriggerType', 'Immediate');
set(ao, 'RepeatOutput', 1);

valor=0;
 while valor~=9,
     
 disp('introduza o valor: ');
 valor=input('');
 
  if valor>=-5 & valor<=5, 
    
    x=[0:valor/100:valor];  
    waveData = offset+x;
    for x(1,:):x(size(x),:),
    putdata(ao, [waveData]);
    start(ao); 
    delete(ao);
end
end  
end
toc
%end

disp('pp');
pause(0.05);
z=0+offset;
putdata(ao, [z]);
start(ao);
% trigger(ao);
stop(ao);
delete(ao);
