Capzos
Computer
- Aug 8, 2005
- 7
i have a matrix which has 16 columns and varying number of rows.. i
need to replace the elements ranging from -50 to 50 with zero and the
rest should remain the same.. i have coded for a single element
search and replace which is
[m, n] = size(Data);
for i = 1: m
for j = 1:n
if ( Data(i,j) == 1 )
Data(i,j) = 0;
end
end
end
but how do i do it for a range of -50 to 50 instead of a 1 in my
code.. could anyone help me out.. also please suggest me if there are
any matlab function which does this with out the use of the for
loops...
Regards,
capzos
need to replace the elements ranging from -50 to 50 with zero and the
rest should remain the same.. i have coded for a single element
search and replace which is
[m, n] = size(Data);
for i = 1: m
for j = 1:n
if ( Data(i,j) == 1 )
Data(i,j) = 0;
end
end
end
but how do i do it for a range of -50 to 50 instead of a 1 in my
code.. could anyone help me out.. also please suggest me if there are
any matlab function which does this with out the use of the for
loops...
Regards,
capzos