문제

나는있다 pts 다음과 같은 2D 포인트 (x, y)가있는 파일 :

version: 1
n_points: 5
{
159.128 108.541
230.854 109.176
164.841 179.633
193.404 193.597
192.769 229.143
}

이 파일을 읽고이 데이터를 MATLAB의 변수로 가져 오는 방법은 무엇입니까?

감사.

도움이 되었습니까?

해결책

나는 그렇게 할 것입니다

 FileId=fopen(Filename)
 npoints=textscan(FileId,'%s %f',1,'HeaderLines',1)

 points=textscan(FileId,'%f %f',npoints{2},'MultipleDelimsAsOne',1,'Headerlines',1)
 % now you have the values you want you can put them in a matrix or any variable
 Y=cell2mat(C);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top