Small Satellites

Home » Math » Swirl,Matlab Code

Swirl,Matlab Code

 

clc; clear all; close all;
x = -20:0.1:20;
sz = size(x);
ind = 0;
b = 6
for n = 1:15 %
for i = 1:sz(2)
    for j = 1:sz(2)
        sw(i,j) = sin(b*cos(sqrt(x(i)^2+x(j)^2))-n*atan2(x(i),x(j)));
    end
end
ind = ind +1;
fig = figure('Position',[0 0 800 800]);
hold on;
imagesc(sw);
colormap bone;
axis off;
set(fig, 'color', [0 0 0]);
set(gcf, 'InvertHardCopy', 'off');
hold off;
%print(fig,['Sw',num2str(ind)],'-djpeg  ','-r300');
close all;
end


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Recent Post

%d bloggers like this: