hot to write text file
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
%%Read file
str=fileread('C:\Users\merve\OneDrive\Masaüstü\S.txt');
%%Remove some annoying segments
str=regexprep(str,'(0 0 0)',' ');
%%Find data in brackets and remove brackets
n='(+|-)?\d+(\.\d+)?(e(+|-)?\d+)?';
str_out=regexp(str,['[(]',n,'\s',n,'\s',n,'[)]'],'match');
str_out=regexprep(str_out, '(', '')';
str_out=regexprep(str_out, ')', '');
num_out=cellfun(@str2num,str_out,'UniformOutput',false);
num_out=cell2mat( num_out )
1 Kommentar
Geoff Hayes
am 21 Dez. 2021
@merve arpacioglu - what exactly is your question? Please clarify and describe how it relates to the code that you have presented.
Antworten (1)
Siehe auch
Kategorien
Mehr zu Text Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!