given a mixture of two signals, how to separate it to its base components? I have a signal that contains two components. How can I separate it two its two components in matlab?
Please note that the location and shape of components are different in each experiment and we do a lot of experiments. It should automatically detect the two components based on the frequency contents. I have added this comment because some people suggested 
c1 = x(1:80);c2 = x(81:end);  

I do not mean such separation.
I would suggest you take a look at 'independent component analysis', and 'blind source separation' tasks. In general, given a signal of mixtures of components to be separated to its contents well addressed by optimization in complicated cases. Here you show one example, but probably in each experiment you have something very different. I will also take a look at my files to see if still I have relevant codes to solve it or not.