say I have
function [x,y]=valuesof(data)input= data;t=length(data);for z=2:t if input(z-1)>input(z) && input (z)<input(z+1); x= 'the values of the indices' i.e z y= 'the input values of the sequence that satisfies the condition' input(z) endendend
how would I create a new colum for each value that satifies my if statement. The 1st column for the indice that the if statement is valid and the 2nd column for the value of input(z)
so for example if I have data of a column as
1-310-13
it would store the values of x
as
25
and y as
-3-1
I would not like to use any built in matlab functions such as diff, sign and find etc. Thanks for the help
Best Answer