ahmad_abdulghany
Advanced Member level 4
- Joined
- Apr 12, 2005
- Messages
- 1,206
- Helped
- 102
- Reputation
- 206
- Reaction score
- 22
- Trophy points
- 1,318
- Location
- San Jose, California, USA
- Activity points
- 11,769
I have a text file that contains two colomns of row data, only numbers
here's a sample of it:
I tried to use import data wizard, and load() function, but it always returns the last elements equal zeros (in first colomn)
I tried to write this function:
But i failed, because tline is not a two colomns vectro, i.e. its contents are many characters actually,
you can check that by typing:
in the matlab command...
Can anyone help ?
Here's the file i want to read its elements out in a matrix..
Thanks alot in advance,
Ahmad,
here's a sample of it:
Code:
2.00000e-10 2.12723e-01
2.80000e-10 2.12723e-01
3.60000e-10 2.12723e-01
4.40000e-10 2.12723e-01
5.20000e-10 2.12723e-01
6.00000e-10 2.12723e-01
6.80000e-10 2.12723e-01
7.60000e-10 2.12723e-01
8.40000e-10 2.12723e-01
9.20000e-10 2.12723e-01
1.00000e-09 2.12723e-01
1.08000e-09 2.12723e-01
1.16000e-09 2.12723e-01
1.24000e-09 2.12723e-01
2.84000e-09 2.12723e-01
2.92000e-09 2.12723e-01
3.00000e-09 2.12723e-01
3.08000e-09 2.12723e-01
3.16000e-09 2.12723e-01
3.24000e-09 2.12723e-01
3.32000e-09 2.12723e-01
3.40000e-09 2.12723e-01
3.48000e-09 2.12723e-01
3.56000e-09 2.12723e-01
3.64000e-09 2.12723e-01
I tried to use import data wizard, and load() function, but it always returns the last elements equal zeros (in first colomn)
I tried to write this function:
Code:
a=[];
fid=fopen('trial.dat','r');
while 1
tline=fgetl(fid);
if ~ischar(tline),break,end;
a=[a;[tline]];
end
fclose(fid)
But i failed, because tline is not a two colomns vectro, i.e. its contents are many characters actually,
you can check that by typing:
Code:
tline' % transpose
Can anyone help ?
Here's the file i want to read its elements out in a matrix..
Thanks alot in advance,
Ahmad,