File Exchange Pick of the Week

Our best user submissions

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Fruit Package

Posted by Jiro Doke,

Jiro‘s pick this week is A simple fruit package by kim9091.

This one is a fun and well-written example of 3D graphics using basic patch objects. You can draw 13 different kinds of fruits with ability to specify geometric parameters. For example, here’s a strawberry.

s = fruit.strawberry([0 0 0], 5);

To change the orientation, you simply use the rotate function.

rotate(s,[0 1 0],-45)

Let’s place a slice of lemon on the side.

l = fruit.lemon([5 8 0],10);
rotate(l,[1 0 0],-45)

Now, enjoy your fruit plate! (from the FEX entry)


Give it a try and let us know what you think here or leave a comment for kim9091.

Get the MATLAB code

Published with MATLAB® R2017b


Comments are closed.