Drawing a Cartoon in MATLAB

Posted on at


Drawing a Cartoon in MATLAB

Following is the description of a MATLAB fun code which makes a water jug when executed. It is created by using the data previously saved in an excel file. The commands used are xlsread, for loop, getframe and linspace only. It is very interesting to use Matlab for fun stuff.

Matlab Code:

clear all
close all
data=xlsread('cartoon.xlsx');
x=data(:,1);
y=data(:,2);
for i=1:length(x);
hold on
plot(x(i),y(i),'.m','MarkerSize',20)
F(i)=getframe;
end

Output:

For other images of outputs using a little variation in code for color, CLICK HERE

For further assistance watch the following video

You can also download the data file cartoon.xlsx

There is a lot more about MATLAB. Visit my blogs and videos by clicking the following links.

My Videos

My Blogs



About the author

SalmaAnnex

Haripur, Pakistan

Subscribe 0
160