Creating a matlab function that reads the raw input data, given in the text file.

As I mentioned in the title, I want to create a matlab function, reading the input from a text file.
However, text file contains both double and string variables. Hence, I must parse all the raw input data correctly and in correct format.
Can some one please help me?

回答 (1 件)

Peng Li
Peng Li 2020 年 3 月 27 日

0 投票

Is the text file contains data with fixed columns and rows? If yes, you can try using readtable. If there is a headline in the text file, it automatically generate variable names with the headline (potentially some changes to make it consistent with matlab variable naming rules). otherwise, in calling the readtable, specific ReadVariableNames as 0.

1 件のコメント

alperen demirci
alperen demirci 2020 年 3 月 27 日
Text file contains data with fixed columns (only 1 column) however, depending on a variable
(if 13th row is 1 or 2) its row number can be either 20 or 30.

サインインしてコメントする。

質問済み:

2020 年 3 月 27 日

コメント済み:

2020 年 3 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by