How to read large data and plot them in matlab

Hi. I have a file containing digit numbers with a large number of rows and three columns, generated by C program. When I use the ImportData to import them only half of the first coloumn and most of the second one are imported. The remaining get NaN. How can I import all the data of column 1 and 2 and plot them?
Thank you

8 commentaires

KSSV
KSSV le 8 Mai 2019
It depends on how the file is....does it have any text after certain lines? Why don'y uoi upload your file?
Davoud
Davoud le 8 Mai 2019
No, it doesn't.
How I should upload it? The Attachments icon doesn't work.
Zip the file attach that
Is it fixed width instead of space or tab delimited?
Davoud
Davoud le 8 Mai 2019
Yes, it is fixed width.
Davoud
Davoud le 8 Mai 2019
There is a problem with the attachment.
This is my email address: davodghn@yahoo.com
Please email to me, I send the file to you.
Thank you
Davoud
Davoud le 8 Mai 2019
Modifié(e) : Davoud le 8 Mai 2019
In fact, Import Data works and opens a file where three upper rows are explanations and the other ones are numbers. In order to plot, I import again the coloumn 1 and 2. They are saved in Workspace as two separeted files (vec1 and vec2) where almost all the numbers can be retrived in command window. But when I use the plot command, the resulted figure is half of the expected one. The values of bigger than 0 of x axis become NaN and are not shown in the figure.
Importdata cannot handle fixed width fields except when there just happens to be one or more spaces between fields every time.

Réponses (0)

Cette question est clôturée.

Question posée :

le 8 Mai 2019

Clôturé :

le 20 Août 2021

Community Treasure Hunt

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

Start Hunting!

Translated by