I have written the below MATLAB code. I want to know how can I optimize it without using for loop. Any help will be very appreciated.
MATLAB code: