Need Help- .txt to array values

I have a text file with the following values,
10210000000
10211000000
10210000000
10204000000
10201000000
10201000000
i used "textscan" command to read this file, but i want to store that values in an array.
i.e.
data=[10210000000 10211000000 10210000000 10204000000 10201000000 10201000000]
is it possible to do in MATLAB

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 9일
편집: Azzi Abdelmalek 2013년 9월 9일

0 개 추천

You can use
v=dlmread('file.txt')
%or
v=importdata('file.txt')
%or
fid=fopen('file.txt');
v=cell2mat(textscan(fid,'%f'));
fclose(fid)

카테고리

도움말 센터 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

질문:

2013년 9월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by