How to skip a parameter in a function? ex: A = fread(obj,size,'precision') without size.
Afficher commentaires plus anciens
Hello.
Is here any syntax to not enter the second input to a function while entering the third?
I like to use A = fread(s, 'uint16');
But matlab complains that 'uint16' is not valid for size...
Réponse acceptée
Plus de réponses (2)
Greg
le 12 Déc 2014
0 votes
The syntax for fread is for the second input to be the number of elements to read. If you're asking the question for this case specifically, why not just include that as an input? If you want to read the whole file and don't know how many elements it has, I believe you can just use a 'very large number' and it will read the whole file.
e.g. A = fread(s,10^100,'uint16');
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!