extracting coordinates numbers from array of coordinates
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello ,I Have a text file which i mannaged to sliceout one subtable from it.(attched txt file)
and convert the frequency string to a number array.
next i ned to convert the string array of data into number array but its more difficult.
each cell is of form '(-7.30313259052058e-002dB,-4.26354774426478e+000°)'
in the end of this script i am trying to use text scan however it gives me two empty cell with square symbols in them.
i would like to get the D array into other array 2X1000 with the numbers in them.
Thanks
fid=fopen('testnew1.txt');
g= textscan(fid,'%s','delimiter','\n');
leng=length(g{1});
fclose(fid);
k=1;
for j=3:1:1002
f_str(k)=g{1}(j,1);
C= strsplit(char(g{1}(j,1)),'\t');
F(k) = strsplit(char(C{1}),' ');
D(k)=strsplit(char(C{2}),' ');
frec_subtable(k) = str2num(F{k});
%m(k) = textscan(D(k),'%d');
%cords4= textscan(t, '(%fdB%f)');
h = textscan(D(k), '(%4fdB%f°)', 'Delimiter',',')
k=k+1;
end
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!