How to plot selective data?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have some data in the following form, outputted from a different computer program:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149852/image.png)
(That is, 3 separate columns of data...continuing on for 1000 rows) I am wondering how to create a plot with JUST the first and second columns, or first and third columns, of data--seeing as doing this manually would take forever. How do I arrange these data such that they're in matrices that are readable for MATLAB? Thanks much in advance!
0 Kommentare
Antworten (2)
Azzi Abdelmalek
am 19 Sep. 2013
Bearbeitet: Azzi Abdelmalek
am 19 Sep. 2013
If A is your matrix
plot(A(:,1),A(:,2))
%or
plot(A(:,1),A(:,3))
If your data are in a text file you can read it:
A=dlmread('yourfilename.txt')
Jan
am 19 Sep. 2013
What exactly is the problem? Are these data written to a file and you are looking for the fscanf command to read them? Does dlmread as suggested by Azzi work or not?
0 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!