Deleting columns corresponding to time value

조회 수: 2 (최근 30일)
jacob Mitch
jacob Mitch 2019년 11월 11일
댓글: pavan kumar 2019년 11월 22일
If I have a time axis of
t=[0:1:4]; %time step 1
that corresponds to x,y,z data as an array where the first row is x second is y third is z say
data=[1,2,3,4,5;1,4,5,6,7;2,3,8,4,5]; %5 columns
how would I discard values for if t<3 It deletes all the columns corresponding to the time, so it gets rid of the 1st 2nd and 3rd column to get and produces
data=[4,5;6,7;4,5];

채택된 답변

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019년 11월 11일
solution:
data(:,t<3)=[];
disp(data)

추가 답변 (1개)

David Hill
David Hill 2019년 11월 11일
data=data(:,data(1,:)>3);

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by