code for getting square waveform

hi... i ve the matlab code for converting ascii to binary for example: BiT-01000010011010010101010000001010 this binary is stored in a file in text format we need to write a code for getting a square waveform for 1’s and 0’s stored in file. Waveform of the form 1=5 volts and 0=0volts or -5 volts pls help me

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 10월 14일

0 개 추천

Use textscan() to read the text file, the value will be 1 or 0.
Data=[1 0 1];
Volt=Data*10-5; % or Volt=Data*5;

카테고리

도움말 센터File Exchange에서 Standard File Formats에 대해 자세히 알아보기

태그

질문:

2011년 10월 14일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by