MATLAB: Convert analog to digital

analogdigitalMATLABplotsine

I am plotting a signal with the following code. I want to convert this signal from analog to digital. Is there any way i can do it, i need to plot a straight line to x axis with each value which i am getting. Thank you in advance.
iSample = 1:iMaxSamples;
Value_AD_Value(iSample) = AD_Value_iAmplitude(iTimeIndex,iChannel,iSample); plot(handles.AD_Values,iSample,Value_AD_Value,'LineWidth',2,'Color',ColorSet(ColorArray(iChannel),:));

Best Answer

Use stem function instead of plot