MATLAB Answers

0

Deleting columns corresponding to time value

Asked by jacob Mitch on 11 Nov 2019 at 14:02
Latest activity Commented on by pavan kumar on 22 Nov 2019 at 8:49
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];

  0 Comments

Sign in to comment.

2 Answers

Answer by JESUS DAVID ARIZA ROYETH on 11 Nov 2019 at 14:23
 Accepted Answer

solution:
data(:,t<3)=[];
disp(data)

  1 Comment

thank u sir

Sign in to comment.


Answer by David Hill on 11 Nov 2019 at 14:37

data=data(:,data(1,:)>3);

  0 Comments

Sign in to comment.