필터 지우기
필터 지우기

Input files editing format

조회 수: 1 (최근 30일)
RAKESH KUMAR TOTA
RAKESH KUMAR TOTA 2021년 1월 18일
댓글: RAKESH KUMAR TOTA 2021년 1월 18일
Hi, Good morning
I have an input file input.txt, i need to save the format in different two files node.txt and el.txt in the format attached files. Any help would be appreciated . Thank you inadvance.
  댓글 수: 2
Mario Malic
Mario Malic 2021년 1월 18일
What is the actual question here?
RAKESH KUMAR TOTA
RAKESH KUMAR TOTA 2021년 1월 18일
i need to extract data from input.txt file ( nodes and element data) and save in the format node.txt and el.txt as mentioned in the uploaded files. Thank you.

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

채택된 답변

Walter Roberson
Walter Roberson 2021년 1월 18일
fid = fopen('input.txt', 'r');
nodedata = cell2mat( textscan(fid, '%*f,%f,%f', 'CommentStyle', {'*Heading', '*Node'}) );
eldata = cell2mat( textscan(fid, '%*f,%f,%f,%f,%f', 'HeaderLines', 1) );
fclose(fid)
  댓글 수: 8
RAKESH KUMAR TOTA
RAKESH KUMAR TOTA 2021년 1월 18일
Thanks a lot . It really saved a lot of time.
RAKESH KUMAR TOTA
RAKESH KUMAR TOTA 2021년 1월 18일
eldata (:, 1) = 1; % why ??? ... I need to assign materail no.1 to all elements in my code. Thank you

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by