diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2015-08-12 15:15:56 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2015-08-12 15:15:56 -0400 |
commit | 5787ea975f29864dc4bc55518484e992d192e12c (patch) | |
tree | 8150452cbe561d472ed656a555966a8f2280515f | |
parent | c6162445e001e09a250c5f960d66733366ee87d4 (diff) | |
download | linux-matlab-gpib-master.tar.gz linux-matlab-gpib-master.zip |
-rw-r--r-- | E440a_take_data.m | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/E440a_take_data.m b/E440a_take_data.m index ef735a4..b6bdf75 100644 --- a/E440a_take_data.m +++ b/E440a_take_data.m @@ -78,7 +78,7 @@ end %% Unix specific parameters
if isunix
- obj1=lgpib('Agilent_E4405b')
+ obj1=lgpib('Agilent_E4405b');
end
%disp('--------------------')
@@ -108,15 +108,18 @@ tr3 = NaN(Npoints,1); fwrite(obj1, ':FORMAT:TRACE:DATA ASCII');
if channels_to_grab_flag(1);
-tr1_string = query(obj1, ':TRACE:DATA? TRACE1;'); % select traces to grab
+ tr1_string = query(obj1, ':TRACE:DATA? TRACE1;'); % select traces to grab
+ tr1 = sscanf(tr1_string, '%f,');
end
if channels_to_grab_flag(2);
-tr2_string = query(obj1, ':TRACE:DATA? TRACE2;');
+ tr2_string = query(obj1, ':TRACE:DATA? TRACE2;');
+ tr2 = sscanf(tr2_string, '%f,');
end
if channels_to_grab_flag(3);
-tr3_string = query(obj1, ':TRACE:DATA? TRACE3;');
+ tr3_string = query(obj1, ':TRACE:DATA? TRACE3;');
+ tr3 = sscanf(tr3_string, '%f,');
end
%disp('Reading Spectrum Analyzer parameters...');
@@ -143,18 +146,6 @@ end %disp('Spectrum Analyzer data communincation is done');
-%% Convert the grabbed traces from strings into vectors
-if channels_to_grab_flag(1);
-tr1 = sscanf(tr1_string, '%f,');
-end
-
-if channels_to_grab_flag(2);
-tr2 = sscanf(tr2_string, '%f,');
-end
-
-if channels_to_grab_flag(3);
-tr3 = sscanf(tr3_string, '%f,');
-end
% Transpose the vectors
tr1 = tr1';
|