Plot of dspesific rows and columns
1 view (last 30 days)
Show older comments
I have a txt file that I would like open, and plot the values from row 39 column 2 (x-axis) vs row 39 column 4 (y-axis) for about 8000 rows. It is also desirable to only plot every 10th row to make the script go faster.
0 Comments
Answers (1)
Star Strider
on 17 Jul 2019
Importing your file depends on what is in it (numeric only, numeric with text headers, or something else). If you have R2019a or later, use the readmatrix function to import your file. Otherwise, dlmread and its friends are options. If you need help with that, attach (upload) your file (or a representative sample of it) here.
Once you have imported your file, the rest is straightforward:
A = readmatrix('YourFile.txt');
x = A(39:10:end, 2);
y = A(39:10:end, 4);
plot(x, y)
grid
0 Comments
See Also
Categories
Find more on Axis Labels 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!