[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: easy problem for expert users
From: |
Andy Buckle |
Subject: |
Re: easy problem for expert users |
Date: |
Tue, 22 Jun 2010 16:35:16 +0100 |
2010/6/22 Paolo Gaffu <address@hidden>:
> I'm happy to join this mailing list help service!!!
> I'm Paolo, from Italy, so sorry for my english.
> I'm a novel Matlab user, but i'm a Ubuntu user and i like all open
> source software...so i want to move from matlab to Octave.
> I have a very stupid prblem (i think!!!), i want to import in a
> different variables 3 external txt files, where columns are separated by
> tab.
> For two of them i had no problem, i'm able to import, but for the last i
> have a lot of problem.
> I try with load, read and many other function but nothing.
> Can someone help me? I hope yes...
> I had attached a trimmed file i want to import..
> Hear you soon...
> Paolo
>
>
> Time c[HbO2]-CH 1 c[HHb]-CH 1 c[tHb]-CH 1 TOI-CH 1
> c[HbO2]-CH 2 c[HHb]-CH 2 c[tHb]-CH 2 TOI-CH 2
> c[HbO2]-CH 3 c[HHb]-CH 3 c[tHb]-CH 3 TOI-CH 3 c[HbO2]-CH
> 4 c[HHb]-CH 4 c[tHb]-CH 4 TOI-CH 4
> 0.025 86.316 12.201 98.517 87.615
> 87.752 13.391 101.144 86.76 74.795
> 16.092 90.887 82.295 11.791 13.03
> 24.821 47.503
> 0.05 86.186 12.12 98.306 87.671 87.788
> 13.39 101.178 86.766 75.422 16.173
> 91.595 82.343 12.562 12.245 24.808
> 50.64
> 0.076 86.612 11.959 98.571 87.868
> 87.909 13.351 101.26 86.815 74.714
> 16.218 90.932 82.165 11.145 12.827
> 23.972 46.492
> 0.101 86.736 11.884 98.62 87.949 87.738
> 13.393 101.131 86.756 76.282 16.004
> 92.286 82.659 11.717 12.717
> 24.434 47.955
> 0.126 86.174 12.211 98.385 87.589
> 87.992 13.399 101.392 86.785 75.714
> 16.118 91.832 82.448 11.062 13.229
> 24.291 45.54
> 0.151 87.013 11.909 98.922 87.961
> 88.239 13.325 101.564 86.881 75.67
> 16.056 91.725 82.496 12.138 12.761
> 24.899 48.749
> 0.176 87.147 11.867 99.014 88.014
> 88.313 13.404 101.717 86.822 76.626
> 15.977 92.603 82.747 12.133 12.768
> 24.901 48.726
> 0.202 87.313 11.915 99.228 87.992
> 88.247 13.373 101.619 86.841 76.167
> 16.086 92.252 82.563 13.162 12.06
> 25.222 52.185
> 0.227 87.613 11.904 99.517 88.038
> 88.503 13.379 101.882 86.868 76.443
> 15.989 92.432 82.702 12.041 12.656
> 24.697 48.756
> 0.252 87.074 11.867 98.941 88.006
> 88.515 13.38 101.895 86.869 75.848
> 16.11 91.958 82.481 12.749 12.573
> 25.322 50.348
> 0.277 86.668 12.006 98.674 87.833
> 88.698 13.329 102.028 86.935 75.548
> 16.24 91.788 82.307 12.037 12.875
> 24.913 48.318
> 0.302 87.566 11.851 99.417 88.08 88.414
> 13.321 101.735 86.906 76.534 16.085
> 92.62 82.633 11.609 12.896 24.505
> 47.375
> 0.328 87.215 12.008 99.223 87.898
> 88.417 13.365 101.782 86.869 75.59
> 16.152 91.742 82.394 11.45 13.027
> 24.477 46.777
> 0.353 86.907 11.987 98.894 87.879
> 88.361 13.414 101.775 86.82 76.579
> 16.014 92.592 82.705 12.909 12.418
> 25.327 50.971
> 0.378 87.137 11.978 99.115 87.915
> 88.654 13.316 101.97 86.941 75.781
> 16.192 91.972 82.395 11.847 12.814
> 24.661 48.04
> 0.403 87.283 11.96 99.243 87.948 88.288
> 13.405 101.693 86.818 76.528 16.074
> 92.601 82.642 11.375 12.7 24.076
> 47.248
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
>
-------------file: load_nir.m" --------------------
function [headings vals]=load_nir(filename)
fid=fopen(filename,'r'); % TODO: test for IO error
line=fgetl(fid);
headings=strsplit(line,"\t");
vals=zeros(0,length(headings)); % TODO: faster if you can init this
to correct size
while -1~=(line=fgetl(fid))
cell_arr=strsplit(line,"\t");
char2d=char(cell_arr);
numbers=str2num(char2d)';% NB transpose
vals(end+1,:)=numbers;
end
end
---------------------------------------
--
/* andy buckle */
easy problem for expert users, John W. Eaton, 2010/06/22