MATLAB Answers

How to read .params file via matlab?

조회 수: 8(최근 30일)
Ivan Michael
Ivan Michael 1 Apr 2020
댓글: Rik 2 Apr 2020
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

Rik
Rik 1 Apr 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?
Ivan Michael
Ivan Michael 1 Apr 2020
it's a kind of text data, but its .params file. To be honest I would like to read this file , like a txt file, and after that I would like to change one number from one specific line in this file

로그인 to comment.

채택된 답변

Rik
Rik 1 Apr 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

Ivan Michael
Ivan Michael 2 Apr 2020
Ok thank you first of all., My question is after reading this file How could I change one a specific line (let's say line 65) of the file in order to make it?
Rik
Rik 2 Apr 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.

로그인 to comment.

추가 답변(0개)

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by