Matlab connection with usb
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 24 Mag 2021
Modificato: Walter Roberson
il 25 Mag 2021
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.
Risposte (0)
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!