|
From: Prash on 19 Jun 2008 02:22 "Prash " <prashant83_mishra(a)rediff.com> wrote in message <g3a53q$qd4$1(a)fred.mathworks.com>... > Piter_ <x.piter(a)gmail.com> wrote in message <dbd26db3- 4d03- > 4dd7-bb3d-4bbbf1daa8cd(a)e53g2000hsa.googlegroups.com>... > > > > On Jun 17, 11:40 am, "Prash " > > > <prashant83_mis...(a)rediff.com> wrote: > > > > > fid=fopen('file.txt','r'); > > > command shows missing variable or function. > > > prash > > > > Strange. Can you post full output together with command > line. > > On my computer it works even without having the file. > > Any way I have to tell you that it will read the file in > matlab as a > > column of strings. To plot it you will need to convert it Now I am able to read the ascci file in matlab. I want to convert characters to their ascii values. for this I am using a loop to access the values from the original file and using abs command to convert to the ascii value. like x=s(i,j) abs(x) but its not giving the value of the particular element. rather it prints the values of s ( i j ). can anyone help me? > Prash
From: Piter_ on 19 Jun 2008 04:03 On Jun 19, 8:22 am, "Prash " <prashant83_mis...(a)rediff.com> wrote: > "Prash " <prashant83_mis...(a)rediff.com> wrote in message > > <g3a53q$qd...(a)fred.mathworks.com>... > > > Piter_ <x.pi...(a)gmail.com> wrote in message <dbd26db3- > 4d03- > > 4dd7-bb3d-4bbbf1daa...(a)e53g2000hsa.googlegroups.com>... > > > > > On Jun 17, 11:40 am, "Prash " > > > > <prashant83_mis...(a)rediff.com> wrote: > > > > > fid=fopen('file.txt','r'); > > > > command shows missing variable or function. > > > > prash > > > > Strange. Can you post full output together with command > > line. > > > On my computer it works even without having the file. > > > Any way I have to tell you that it will read the file > in > >matlabas a > > > column of strings. To plot it you will need to convert > > it > Now I am able to read the ascci file inmatlab. I want to > convert characters to their ascii values. for this I am > using a loop to access the values from the original file > and using abs command to convert to the ascii value. > like > x=s(i,j) > abs(x) > but its not giving the value of the particular element. > rather it prints the values of s ( i j ). > can anyone help me? > > > Prash Hi Prash The file you have sent me looks like this. I dint know how this symbols correspond to numbers. Patient Id:1234 0:0:1:! fJeJdIdIfJeJdI eIfJeJdIdIdJbJeK hJrN{SSzRnWjUeMaGcIeIdJeJeKeLeKdJeJdJeJeKeJfKeJfJfKfLfJeJeKfL eJ fJ gJfLfK fJ gK gK hK gK hKiKiKiJiKkLkL jK jK kL lL kK jKkLjKiJhJ ...... I can give you an example how i read my files. The file look like this: Batch rate_cox_activ002.rre Instrument ID 021617 Sample p1 rate Data Mode A Smoothing None Date Collected 6/11/2008 Time Collected 3:24:36 mm:ss.sss Value 00:00.000 0.0711 00:00.125 0.0722 00:00.250 0.0707 00:00.375 0.0715 00:00.500 0.0712 .... to read it into matlab I use this code: fid=fopen('file.txt','r'); s = ''; while ~feof(fid) line = fgetl(fid); if isempty(line), break, end s = strvcat(s,line); end ro=length(s(:,1)); rate_data=[str2num(s(9:end,1:2))*60+str2num(s(9:end,4:5)) +str2num(s(9:end,6:9)) str2num(s(9:end,10:end))]; hope it helps. Petro
|
Pages: 1 Prev: physical component modeling Next: Solving Quadratic equations |