what is the "count" mean?

hi
What do these commands do? please
what is "count"?
[v1,count]=fscanf(fid,'%f',[2,numpt]);
fclose(fid);
v1=v1';
code=v1(:,2);
code_count=zeros(1,2^numbit);

Réponses (1)

KSSV
KSSV le 18 Nov 2021
Modifié(e) : KSSV le 18 Nov 2021

1 vote

[v1,count]=fscanf(fid,'%f',[2,numpt]); % reading data from the file into 2 rows and numpt coulmns; count gives you total numbers read into v1
fclose(fid); % closing the file
v1=v1'; % transpose
code=v1(:,2); % pick second column
code_count=zeros(1,2^numbit);
Check numel(v1) and count, they should be equal.

1 commentaire

ati fayazan
ati fayazan le 18 Nov 2021
thanks
I found these commands to output an ADC to MATLAB. Do you know if the ADC outputs it needs to get are just the bits or not? If not, what is the meaning of v 1?Please
<disp('HP16500C State Card');
filename=input(
'Type a:\filename or Press RETURN for HPIB Data Transfer: ');
if isempty(filename)
filename =
'listing';
end
fid=fopen(filename,'r');
numpt=input(
'Data Record Size (Number of Points)? ');
fclk=input(
'Sampling Frequency (MHz)? ');
%MAX1448 - 10-bit data converter
numbit=10;
%Discard first 13 lines from the data file, which do not contain data
for i=1:13,
fgetl(fid);
end
[v1,count]=fscanf(fid,'%f',[2,numpt]);
fclose(fid);
v1=v1';
code=v1(:,2);
%Display a warning, when the input generates a code greater than full-scale
if (max(code)==2^numbit-1) | (min(code)==0)
disp('Warning: ADC may be clipping!!!');
end
%Plot results in the time domain
figure;
plot([1:numpt],code);
title('TIME DOMAIN')
xlabel('SAMPLES');
ylabel('DIGITAL OUTPUT CODE');

Connectez-vous pour commenter.

Catégories

En savoir plus sur Functions dans Centre d'aide et File Exchange

Tags

Commenté :

le 18 Nov 2021

Community Treasure Hunt

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

Start Hunting!

Translated by