Easiest way to skip a few lines and then read data from this text file ( x and y) to draw a plot.

12 次查看(过去 30 天)
I have attached the file I'm trying to do this for.
Thanks a lot!

采纳的回答

Star Strider
Star Strider 2020-1-22
编辑:Star Strider 2020-1-22
The easiest way I can think of is to use the dlmread function:
filename = '6in_nomass_5.txt';
Data = dlmread(filename, '\t', 6, 0);
There are others, such as readmatrix that are likely even easier, however you did not state the release you are using, so dlmread is a safe option.
EDIT — To draw the plot:
figure
plot(Data(:,1), Data(:,2))
grid

更多回答(1 个)

Jesus Sanchez
Jesus Sanchez 2020-1-22
From yout MATLAB: Home -> Variable -> Import data.
From there you can also create a function that will allow you to import future files.

类别

Help CenterFile Exchange 中查找有关 Graphics Object Identification 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by