From: Arthur Shaw on 20 Apr 2010 13:30 Hi TideMan, Thank you for your response. Are these the coordinates of points in a plane? Yes Why are there a variable number of points in each row? Coordinates in one row belongs to one curve. Does each row represent a curve on the plane? Yes Based on this please guide me. Thanks, Shaw. TideMan <mulgor(a)gmail.com> wrote in message <354e0c5f-c4f3-41d7-9a54-82b21b1cb90b(a)u9g2000prm.googlegroups.com>... > On Apr 20, 8:44 pm, "Arthur Shaw" <405107...(a)nitt.edu> wrote: > > Hi all, > > I am having the coordinates of the curves in a text file in a peculiar format, like listed below: > > (1,1), (1,2), (2,2), (2,3), (3,4), (3,5) > > (1,3), (1,2), (2,2), (2,3), (3,4), (3,5) > > (1,3), (1,2), (2,2), (2,3), (3,4), (2,5), (1,5) > > (2,1), (2,2), (2,3), (3,4), (2,5) > > (1,1), (1,2), (2,2), (2,3), (3,4), (3,5) > > (2,1), (2,2), (2,3), (3,4), (2,5), (1,5) > > and so on... > > From this format, please advise me how to take data and plot curves using the plot command. Or elase give me idea so that in which format i can convert and store it in matlab data file and from that i can plot it. > > Thanks for your help in advance. > > > > Thanks, > > Shaw. > > Are these the coordinates of points in a plane? > Why are there a variable number of points in each row? > Does each row represent a curve on the plane? > > What I'd do first is to remove all those silly parentheses using perl: > perl -p -e "s/)//g;s/(//g" data.txt > data1.txt > > > > You're gonna have to give us some more clues before we can help.
From: us on 20 Apr 2010 14:03 "Arthur Shaw" <405107053(a)nitt.edu> wrote in message <hqkoit$b8b$1(a)fred.mathworks.com>... > "us " <us(a)neurol.unizh.ch> wrote in message <hqk4qf$lh1$1(a)fred.mathworks.com>... > > "Arthur Shaw" <405107053(a)nitt.edu> wrote in message <hqjpgk$gfv$1(a)fred.mathworks.com>... > > > Hi all, > > > I am having the coordinates of the curves in a text file in a peculiar format, like listed below: > > > (1,1), (1,2), (2,2), (2,3), (3,4), (3,5) > > > (1,3), (1,2), (2,2), (2,3), (3,4), (3,5) > > > (1,3), (1,2), (2,2), (2,3), (3,4), (2,5), (1,5) > > > (2,1), (2,2), (2,3), (3,4), (2,5) > > > (1,1), (1,2), (2,2), (2,3), (3,4), (3,5) > > > (2,1), (2,2), (2,3), (3,4), (2,5), (1,5) > > > and so on... > > > From this format, please advise me how to take data and plot curves using the plot command. Or elase give me idea so that in which format i can convert and store it in matlab data file and from that i can plot it. > > > Thanks for your help in advance. > > > > > > Thanks, > > > Shaw. > > > > one of the solutions > > > > fnam='foo.txt'; % your file name > > r=textread(fnam,'%d','delimiter','\n','whitespace',',()'); > > r=reshape(r.',2,[]).' > > %{ > > % r = % <- five first points, only > > 1 1 > > 1 2 > > 2 2 > > 2 3 > > 3 4 > > ... > > %} > > line(r(:,1),r(:,2),'marker','s','linestyle','none'); > > > > us > Hi us, > Each row coordinnates belong to one curve. > Based on your idea, I am getting one connected graph. Instead it belong to six curves. > Expecting your reply. > Thanks, > Shaw. well... since your example does neither show six rows nor six columns, there's no more help at this point... us
|
Pages: 1 Prev: mex on 64 bits mac os 10.6.3 Next: pls what does i defines. |