MATLAB: Plot circle with radius r and roughness amplitude e

circle with rough circumferenceMATLAB

How to model or plot circular cross-section of radius (r) with roughness of amplitude (e) on the circumference.

Best Answer

Try this
r = 1; % radius
e = 0.15;
theta = linspace(0, 2*pi, 100);
R = r*ones(size(theta)) + (rand(size(theta))-0.5).*e/2;
x = R.*cos(theta);
y = R.*sin(theta);
plot(x, y, '.-');
axis([-r-0.5 r+0.5 -r-0.5 r+0.5])