Matlab connection with usb

조회 수: 8 (최근 30일)
Batuhan Istanbullu
Batuhan Istanbullu 2021년 5월 24일
편집: Walter Roberson 2021년 5월 25일
Hi,
I am just using the below code but it says right side and the left side elements are not equal so how can i make them equal any suggestions will be very usefull;
% temppha(j) = 0;
% Measure duty-cycle N times
fprintf(os,'MEASUREMENT:IMMED:TYPE PK2PK');
fprintf(os,'MEASUREMENT:IMMED:VALUE?');
temppk2pk (j)= fscanf(os,'%f'); %Read p2p value of the output signal. (1V per 100mm/s)
end
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 5월 24일
편집: Walter Roberson 2021년 5월 25일
The fscanf is returning more than one value or is timing out and returning no value or what is returned does not start with a number. Assign the result of the fscanf to a variable and test the size of the result. Or better yet fgetl and examine the results to see what you get, and use sscanf on the character vector.
Batuhan Istanbullu
Batuhan Istanbullu 2021년 5월 24일
I will try that suggestion and let you know what is the result, thank you !

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by