put it in a function
조회 수: 1 (최근 30일)
RAGHUNATHRAJU DASHARATHA 2022년 11월 11일
As per my understanding you want to write your code into a function .
I will be demonstrating it using your code as example below.
count = 0;
for i = 1:N
u = rand(1,2);
count = count+1;
pi_est = count/N*4;
To know more about functions go through this link