How to plot text file in MATLAB

A.J.710
Messages
56
Reaction score
1
I had to use a network analyzer measuring the standing wave pattern along a transmission line taking data points at half mm increments. The software I used got me the values in a text file and the way it is formatted, I can't figure out how to make the left side the X axis and right side the Y axis of a plot. There are hundreds of points so I can't reorganize all of them manually. Below is an example of the first few lines of the text file.

%
-6.639705882353E+1 4.612014117183E-1
-6.637867647059E+1 4.611021652616E-1
-6.636029411765E+1 4.611021652616E-1
-6.634191176471E+1 4.608038003887E-1
-6.632352941176E+1 4.608038003887E-1

Thanks for the help
 
Physics news on Phys.org
Never mind, I figured it out, I'll put the code below for anyone else to reference.

load file.txt;
x = file(:,1);
y = file(:,2);
plot(x,y);
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
3
Views
2K