EasyManuals Logo
Home>Agilent Technologies>Portable Generator>E4438C

Agilent Technologies E4438C Manual

Agilent Technologies E4438C
48 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #46 background imageLoading...
Page #46 background image
46
www.agilent.com/find/esg
An example MATLAB
®
program to generate and save a user data file is shown below.
%************************************ Userdata File Example************************
% Set some constant parameters
numBytes = 16;
bitsPerByte = 8;
% Construct a bit stream
databits = ones(1,numBytes*bitsPerByte); % Sets entire stream to 1's
databits(11:2:29) = 0; % Set some alternating bits to 0's
databits(51:70) = 0; % Set a block of bits to 0's
% Convert from an array of bits to an array of bytes
databytes = ones(bitsPerByte, length(databits)/bitsPerByte); % Make array 8 x N/8
databytes(:) = databits; % Each column is 1 byte = 8 bits
c = [128 64 32 16 8 4 2 1]; % Weight according to bit position
data = c*databytes; % Change to decimal
fid = fopen('Userdata','w'); % Open a file named Userdata
fwrite(fid, data, 'uint8'); % Write the data to the file
fclose(fid); % Close the file
%***********************************************************************************
Appendix

Other manuals for Agilent Technologies E4438C

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies E4438C and is the answer not in the manual?

Agilent Technologies E4438C Specifications

General IconGeneral
BrandAgilent Technologies
ModelE4438C
CategoryPortable Generator
LanguageEnglish

Related product manuals