Drawing a Rose in MATLAB

Posted on at


Drawing a Rose in MATLAB

It is a description of a MATLAB fun code which makes a red rose when executed. It is created by using the data previously saved in an excel file. The commands used are xlsread, for loop, getframe only. It is a dotted rose.

MATLAB CODE:

clear all
close all
data=xlsread('rose.xlsx');
x=data(:,1);
y=data(:,2);
for i=1:length(x);
hold on
plot(x(i),y(i),'.r','MarkerSize',10)
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 rose.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