필터 지우기
필터 지우기

Read in a file with no spaces and write one part of each line into a file

조회 수: 2 (최근 30일)
sogand talebi
sogand talebi 2019년 9월 12일
답변: Jalaj Gambhir 2019년 9월 16일
Hi,
I have a data file with around 180 lines, like the following:
Date Time ,Frequency:
2019-09-11T11:43:02.782Z,9.0694850E+4
2019-09-11T11:43:07.776Z,9.0693890E+4
2019-09-11T11:43:12.779Z,9.0694460E+4
2019-09-11T11:43:17.781Z,9.0693870E+4
2019-09-11T11:43:22.775Z,9.0693370E+4
As you can see there are no spaces between date, time, and frequency determined:
How can I write a matlab script that can take this in and only give me the frequencies: so something like this:
9.0694850E+4
9.0693890E+4
9.0694460E+4
9.0693870E+4
9.0693370E+4
Thank you for your help,
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 9월 12일
편집: Walter Roberson 2019년 9월 12일
However if you only need the frequencies and nothing else, then a plain readtable() and then access the second variable. Or detectImportOptions and set the SelectedVariables of the options to only select the second column, and then readtable()

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

답변 (1개)

Jalaj Gambhir
Jalaj Gambhir 2019년 9월 16일
Hi,
You can use importdata and access the frequencies by:
c = importdata('filename',',',1);
c.data

카테고리

Help CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by