MATLAB: How to form a product of two arrays and add the numerical value of the integral in the plot

array

xDataA = linspace(0,4*pi,1024);
yDataA = cos(xDataA);
xDataB = linspace(0,4*pi,1024);
yDataB = cos(xDataB);
I have two arrays here and I want to plot the product and add the numerical value of the integral in the plot.

Best Answer

xData = linspace(0,4*pi,1024);
yDataA = cos(xData);
yDataB = cos(xData);
p = yDataA.*yDataB ;
plot(xData,p)
Related Question