필터 지우기
필터 지우기

Distance-Time data extraction

조회 수: 1 (최근 30일)
Akash Pandya
Akash Pandya 2019년 2월 20일
댓글: Akash Pandya 2019년 3월 19일
Hi,
I have got distance-time data, I wanted to know how to extract distance data at cut-off of </= 0.5 nm and the corresponding times? I have attached the text file to this question. I hope soemone will be able to direct me into the right direction.
Thank you in advance,
Akash
  댓글 수: 2
Bob Thompson
Bob Thompson 2019년 2월 20일
It is generally considered much simpler to load the entire file into matlab and then remove the excess data with logic indexing. It should look something like this.
data = dlmread('Minimumdistance.txt');
data = data(data(:,1)<=0.5,:);
Akash Pandya
Akash Pandya 2019년 3월 19일
Hi,
Your code worked for me. Say I wanted to apply the same threshold to multiple columns simultaneously, is this possible?
Akash

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

답변 (2개)

Jake Santiago
Jake Santiago 2019년 2월 25일
data = dlmread('Minimumdistance.txt');
data = data(data(:,1)<=0.5,:);
As Bob suggested, this would probably work for you.
Do elaborate your problem a little more if you still having trouble.
  댓글 수: 1
Akash Pandya
Akash Pandya 2019년 3월 17일
Hi,
So the above code worked. I have the various time points at which the distance is <= 0.5 nm. If I wanted to sum the time points how would I go about doing this?
And as I have 442 columns of distance data, how could I then apply the <=0.5 nm threshold to all the columns and get the corresponding time points?

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


Dhanashree Mohite
Dhanashree Mohite 2019년 2월 27일
As per my understanding, as (distance<=0.5nm) and distance is 2nd column, so it should be:
data = dlmread('Minimumdistance.txt');
data = data(data(:,2)<=0.5,:);

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by