필터 지우기
필터 지우기

How to load this .dat file data into matrix format?

조회 수: 35 (최근 30일)
Ernest Adisi
Ernest Adisi 2018년 7월 26일
댓글: Ernest Adisi 2018년 7월 26일
VARIABLES = "x", "y", "displacement-x", "displacement-y"
ZONE T="Frame 0", I=214, J=134
6.000000 6.000000 0.868404 -6.438388
18.000000 6.000000 0.732914 -6.282934
30.000000 6.000000 0.830558 -6.557491
42.000000 6.000000 0.741238 -7.352953
54.000000 6.000000 0.850848 -6.662383
66.000000 6.000000 0.765438 -6.889948
78.000000 6.000000 0.639938 -6.493814
90.000000 6.000000 0.459958 -5.778019
I want to import this dat file with name 'B00050.dat' with the 'VARIABLES' titles as a header, above the 4 columns of numbers below withouth the 'ZONE T. Could you please guide me to the right matlab commands to use so far i've got the following
filename= 'B00050.dat';
M= dlmread(filename);
there's a lot more needed, but not sure as my matlab skills are not adequate . Thanks

채택된 답변

madhan ravi
madhan ravi 2018년 7월 26일
This might help:
https://www.mathworks.com/help/matlab/ref/importdata.html#btldf1f-1
  댓글 수: 1
Ernest Adisi
Ernest Adisi 2018년 7월 26일
Hi, I tried the example but it only seems to give me the header lines without the numbers
filename = 'B00050.dat'
delimiterIn = ' ';
headerlinesIn = 2;
A = importdata(filename,delimiterIn,headerlinesIn);

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by