read a text file
Show older comments
Hi
I need to make a matrix with the text file attached below.
I've considered 'fscanf' and 'readtable'.
But I faced 2 problems.
Some of rows have 8 elements while others have 10.
Also, there are blank cells and I don't know how to handle this to make it 0.
Thanks.

1 Comment
Walter Roberson
on 4 Nov 2020
See https://www.mathworks.com/help/matlab/ref/matlab.io.text.fixedwidthimportoptions.html
Accepted Answer
More Answers (0)
Categories
Find more on Text Data Preparation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

