Thursday, October 23, 2014

Question of Computer Science part2


7. Describe the program (code) segment, resulting in the above figure
Program Segment

>> x = 0:.1:2*pi; >> y = sin(x); >> plot (x,y, '--rs')

8. >> pie([1 .2 5 2 3],[1 0 0 1 0],{'a','b','c','d','e'}
9. >> ezcontour('sqrt(x^2+y^2)')
10.
>> angle = 0:.01:2*pi;
>> radius = sin(6*angle)+pi;
>> polar (angle, radius)
11.
>> x= 0:.1:2*pi;
>> y1= sin(x)
>> y2= cos(x)
>> plot (x,y1)
>> hold on
>> plot(x,y2,'r')
>> hold off
12.
>> sphere
>> daspect([1 1 1])
>> alpha (.5)

13. Given a circle with one unit radius contained inside a square such that the circle's circumference touch sides of the square. Write a script in MATLAB to calculate the proportion of the area of circle and area of the square by using Monte Carlo Simulation

14. Problem number 13, write a MATLAB program using GUIDE consisting of Menu Bar; Context Menu and GUI Window-based Toolbox to calculate the proportion of circle and square area using Monte Carlo Simulation

END OF QUESTIONS

No comments:

Post a Comment