newbie
newbie

Reputation: 4789

Need to create a plot with a set of data stored in file

Hello I'm a octave beginner. I have a data set in a file as bellow:

12 20 3 1 \n
12 3 4 5
.......

These are the four co-ordinates of a rectangle. I need to plot all of these rectangles in a graph. I tried to read the file with following piece of code but I'm getting stuck.

fid=fopen("priminfo.txt");
A = testscan (fid, '%f %f %f %f %*[^\n]') 

Any comments on that will be really helpful

Upvotes: 0

Views: 39

Answers (1)

Peter
Peter

Reputation: 14937

This should work fine:

A = textscan(fid, '%f %f %f %f');

Actually, so should this

A = load('priminfo.txt');

Upvotes: 1

Related Questions