MATLAB: Minimize L2 Norm of a Function

l2 norm

Hi all
As already aware, I am establishing myself in MATLAB and seeking answers sometimes to trivial queries… But need this to get going, so I apologize if my queries sound stupid to you.
Have got response on just a couple of queries so far, please do give me a go on this. I have a normalized random sequence "a" of length "j", which I want to follow and window function "w"(upramp / downramp). The difference between the sequence values after adding "a" to "w" is "e" or error function.
Now, how can I minimise the L2 Norm of the function e(j) = (a(j)- w(j))??? I can calculate
||e||2 = sqrt (sum ((a(j)- e(j)).^2));
But how do I minimize this function??? A prompt help will be appreciated…
Regards

Best Answer

Answer found. By taking derivative of squared error, the function is optimized. The mathematical expression reduces simply to a simplified version of an and an. Using this with a small step in iterations, the desired result is achieved.
Gracias Walter and the community