Pulling certain data from a text file into Matlab with strsplit
이전 댓글 표시
Hi, I want a function that reads this text file. It would be better if this could be read with fgetl and strsplit.Thanks!
답변 (1개)
Try something like this —
% opts = weboptions('ContentType','text');
% M = webread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/873530/miktos1.txt', opts)
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/873530/miktos1.txt', 'ReadVariableNames',0)
for k = 1:size(T1,1)
Var2stsp{k,:} = strsplit(T1{k,2}{:},' ');
end
Var2stsp{1}
Var2stsp{2}
Var2stsp{end-1}
Var2stsp{end}
Experiment to get the desired result.
.
카테고리
도움말 센터 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!