Convert from textread() to textscan()

I'm trying to update my code and I want to know how can I type this with textscan()
formats = '%s%s%s' ;
headerLines4 = 34 ;
delimiter = '" "' ;
name_file = strcat(pathname,'Simu_',simu_s,'_',j_s,'I',i_s,'.txt') ;
[C4{1:3}] = textread(name_file,formats,'headerlines', headerLines4, 'delimiter', delimiter) ;
Thank you very muh in advance and Happy Xmas!

댓글 수: 7

KSSV
KSSV 2016년 12월 21일
Have you tried replacing textread with textscan ? No change only changing function.
Yeah, but I get this error.
Error using textscan
Too many output arguments.
Error in Read_data_analyse (line 54)
[C4{1:3}] = textscan(name_file,formats,'headerlines', headerLines4, 'delimiter', delimiter);
KSSV
KSSV 2016년 12월 21일
no ..output should be only C4 = .....dont write it as C4{1:3}
Aurea94
Aurea94 2016년 12월 21일
I don' understant what you mean with attach the .txt file. Do you want me to show you how does the .txt file look like?
Jan
Jan 2016년 12월 21일
"Attach a file" means, that you can attach it here in the forum. There is an "Attach file" button on top of the field to type the messages.
Aurea94
Aurea94 2016년 12월 21일
Ok. I didn't know about it. I attach 2 files, the one which works with textread (Read_data_analyse.m) and the one which doesn't work with textscan (Read_data_analyse_textscan.m).
KSSV
KSSV 2016년 12월 22일
Text file is missing...

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

질문:

2016년 12월 21일

댓글:

2016년 12월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by