필터 지우기
필터 지우기

How to read specific columns of a text file and write them in an array?

조회 수: 1 (최근 30일)
Verisign
Verisign 2015년 11월 15일
답변: the cyclist 2015년 11월 15일
I have a txt file with two columns and i want to tranform every column into an array how can i do that with fscanf?
  댓글 수: 1
Jan
Jan 2015년 11월 15일
A small example of the file's contents would avoid, that we have to guess all details. What is the contents of the "columns"? What is the wanted output? Please insert the required information by editing the original question, not by appending a comment.

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

답변 (1개)

the cyclist
the cyclist 2015년 11월 15일
My recommendation is to learn to use the Import Data tool in the Command Window. You will be able to preview the data, choose how to import it (e.g. cell arrays, columns, etc.), and generate code that will import it programmatically. Then, by studying the generated code, you can learn about the different ways that MATLAB can import data.

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by