How to read .params file via matlab?
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
Does anybody knows how to read a .params file via matlab?
I have tried command fopen but it's no use?
Thank you
2 commentaires
Rik
le 1 Avr 2020
You mean this kind of .param file? That just looks like a plain text file. What would you want to do next with the data?
Réponse acceptée
Rik
le 1 Avr 2020
Reading text files to Matlab variables is one of the most commons tasks. One of the many, many functions is my readfile function, which is based on the internal fileread function (where my function also tries to account for the encoding, which is probably irrelevant in your case).
You can indeed use fopen, but you do actually need to use the functions with their intended use: fopen will generate a file identifier, which is a kind of handle that points to a specific file. You need it if you want to use fread or fprintf, two functions I would highly encourge you check out. Also note that every function documention page has a footer that contains links to several related functions that could be usefull.
2 commentaires
Rik
le 2 Avr 2020
That depends on how you want to change it. You can either hardcode this change, or you need to find a way for Matlab to generate the required changed text.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Low-Level File I/O dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!