Hi,
This is my first thread in this forum. Hope somebody will help me.
I am writing a simple Matlab program and in that I have an array of numbers with repeating numbers. I want to extract the dissimilar numbers and put in an array. I used below method to do that and it seems to work.
a=1;
for k=1:(2^n-1)
if Logpp(k)~= Logpp(k+1)
Logpp_val(a,1)=Logpp(k,1);
a=a+1;
k=k+1;
else
k=k+1;
end
end
Here I compare the numbers in the original array if they are not equal I write that to the final array.
I'd like to know whether there's an easier or rather optimized way to do this Matlab as I need to repeat this often in the program.
Thanks in advance for the help.