I have the following code and would like to plot the approximation "integ" with respect to the number of tries "N": how do I do that?
%function that evaluates the integral of e^sin(x)
%using Monte Carlo
clc; clear;e=exp(sin(1.0));rand('state',0); %generating random number with the sequence reproducible
ssum=0;%calculate the function of a total of 1000 times
for i=1:100for j=1:10x=rand;ssum=ssum+exp(sin(x));endN=i*10;integ=ssum/N;end
Best Answer