import data from file into an array

조회 수: 8 (최근 30일)
Michael Whitsitt
Michael Whitsitt 2016년 4월 3일
편집: Star Strider 2016년 4월 3일
how do I import data from a text file into an array with the same dimensions in the file?
the file has a 3 x 13 array in the form:
[1,2,3,4,5,6,7,8,9,10,11,12,13;
13,12,11,10,9,8,7,6,5,4,3,2,1;
1,1,1,1,1,1,1,1,1,1,1,1,1,1]
these are not the actual floating point numbers, but that is the layout of the file. how do I import or fscanf this into an array in a MATLAB program?
Thanks
  댓글 수: 1
Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 3일
What is the size of the result?

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

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 3일
편집: Azzi Abdelmalek 2016년 4월 3일
A=importdata('yourfile')
or
A=dlmread('yourfile')

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by