extracting coordinates numbers from array of coordinates

2 ビュー (過去 30 日間)
fima v
fima v 2019 年 6 月 21 日
コメント済み: fima v 2019 年 6 月 21 日
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

回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 6 月 21 日
textscan does not permit cell array inputs as the first parameter.
  1 件のコメント
fima v
fima v 2019 年 6 月 21 日
Hello Walter,what can i do instead?
thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by