How to read a special column from a file?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hy I have this file 'FAR.RSM' produced by another software, now i want MATLAB to read the numbers under column of 'FOE' (you see it in the file) to be used as an input for other calculations, i use this code but it gives me this error: 'Unrecognized variable name 'FOE''. i forgot to say that its columns' may change in order and number. the loaded file here is in 'txt' format and the one i have is in 'RSM' format, it couldn't be loaded here so i changed it in 'txt' format.
opt = detectImportOptions('FAR.RSM','FileType','text'); T = readtable('FAR.RSM', opt); GOE = T.FOE(end)
Great thanks.
2 comentarios
Respuestas (1)
madhan ravi
el 22 de Oct. de 2018
Editada: madhan ravi
el 22 de Oct. de 2018
fid = fopen('FAR.txt')
f= textscan(fid,'%s ' , 'delimiter','\n')
fclose(fid)
c=f{1,1}(10:16)
c=str2num(cell2mat(c))
c=c(:,3) %reads third column
4 comentarios
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!