Skip to content

Ritesh1coder/Generating_shapes_using_MATLAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MATLAB Shape Generator

License MATLAB 2D Shapes 3D Shapes

Project Description

The MATLAB Shape Generator is a versatile project designed to help students, developers, and enthusiasts visualize and understand geometric shapes in both 2D and 3D.
With user-friendly input prompts, this project allows anyone to generate shapes like circles, triangles, cubes, spheres, and more, while automatically saving high-quality PNG images for reports, presentations, or portfolio showcases.
This project combines MATLAB programming, geometry, and visualization skills into a single, easy-to-use package.


πŸ“‚ Project Structure


🧩 Features

2D Shapes

  • Line
  • Circle
  • Ellipse
  • Square
  • Rectangle
  • Triangle
  • Parabola
  • Hyperbola
  • Regular Polygon
  • Star
  • Sector
  • Annulus (Ring)
  • Trapezium
  • Rhombus
  • Custom Polygon

3D Shapes

  • Sphere
  • Cube
  • Cuboid
  • Cylinder
  • Cone
  • Hemisphere
  • Ellipsoid
  • Pyramid (Square base)
  • Triangular Prism
  • Torus (Donut)
  • Tetrahedron
  • Octahedron
  • Dodecahedron
  • Icosahedron
  • 3D Surface Plot

  • User-friendly input prompts for parameters such as side length, radius, height, and number of sides.
  • Automatic PNG image generation for each shape, saved in the same folder for easy sharing and visualization.
  • Ideal for learning geometry, MATLAB programming, and visualization techniques.

βš™οΈ Usage

  1. Open VS Code and navigate to the MATLAB-Codes folder.
  2. Go to the folder containing the shape you want to generate (2D_Shapes or 3D_Shapes).
  3. Open any .m script (e.g., 2_Circle.m or 4_Cylinder.m).
  4. Run the script in MATLAB.
  5. Follow the on-screen prompts to input the required parameters.
  6. The shape will be displayed, and optionally, a .png image will be saved in the same folder.

πŸ§‘β€πŸ’» Author

Ritesh – IIT Patna | Electrical & Electronics Engineering


πŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for details.


⚑ Tips

  • Ensure that MATLAB’s current folder is set to the project folder to avoid path errors.
  • Each .m script is self-contained and can run independently without external dependencies.
  • PNG images are automatically saved, making it easy to include them in presentations, reports, or portfolios.
  • This project is perfect for students, developers, and hobbyists looking to learn geometry, programming, and visualization techniques using MATLAB.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages