usefulSnippets

버전 1.1.0 (38.8 KB) 작성자: J. Benjamin Kacerovsky
Collection of some "little" functions I wrote to make my life easier.
다운로드 수: 73
업데이트 날짜: 2020/9/4

Collection of some "little" functions I wrote to make my life easier. Most of these are very simple and the goal for most was to have a faster more convenient way of accessing built-in Matlab functions to avoid having to type the same code all the time. More Snippets will be added over time.

some parts of this collection of functions have also been submitted to the file exchange as seperate submissions (to make it easier for them to be found on the exchange, and to allow them to be downloaded alone, without adding this entire collection)

EDITOR FUNCTIONS:

insertTemplateHeader on File Exchange

insertTemplateHeader - inserts a predefined header template into an active script; there are a number of similar functions on the MathWorks exchange. As far as I could find, these typically create a new script with the header template (and some seem to require going through a GUI,... while extra typing is exactly what I wanted to avoid). I wrote this version since I generally wanted to be able to insert a header into a function, at the end of my workflow, once I am done building a function and decide to publish it or to add a header so I can remember what it does later on.

VECTOR FUNCTIONS:

drawVector on File Exchange
drawVector - draws 2D or 3D vectors from specified points

planePlotter - on File Exchange
planePlotter - draws a plane defined by a point and normal vector

getVectorAngle - calculates the angle between 2 n-dimensional vectors (built for 2D and 3D, but should work for all dimensions)

FUNCTIONS TO BUILD MESH/VOXEL SPHERES, ELLIPSOIDS, TOROIDS, AND TEST OBJECTS:

Mesh/Voxel spheres, ellipsoids, toroids, and test objects on File Exchange

A number of functions to build gemotric objects (spheres, ellipsoids, torroids) as either FV meshes or voxel arrays.

VoxelSphereCreator - creates a (binary) voxelated sphere of defined radius around a defined point in a given 3D matrix/image. spheres can optionally be deformed along the main axes to create ellipsoids

meshSphereCreator - Creates a triangulated sphere of a defined radius using Matlab's built isosurface function. spheres can optionally be deformed along the main axes to create ellipsoids

multiMeshEllipsoidCreator - creates a series of spheres or ellipsoids (deformed spheres) as FV triangle meshes. surfaces of overlapping spheres are merged into one continuous mesh

multiMeshtoroidCreator - creates a series of toroids as FV triangle meshes. toroids can be deformed.

multiVoxelEllipsoidCreator - creates a series of spheres or ellipsoids (deformed spheres) as voxel array.

drawConnectinCylinders – creates cylinder meshes of defined radius between two sets of points

starship – uses multiMeshEllipsoidCreator to build a FV mesh test object, which resembles a starship (in my opinion)

starship_voxel – uses multiVoxelEllipsoidCreator to build a test voxelized object, which resembles a starship (in my opinion)

Voxel2mesh - plotVoxelArray on File Exchange

functions for meshing and displaying voxel data

Voxel2mesh – creates a triangle or quad mesh FV struct from a voxel array. for each surface face of thee voxel array 1 quad or 2 triangles will be added. i.e. the resulting mesh follows the contours of the voxelized surface (without interpolation as e.g. marching cubes would do)

plotVoxelArray – uses Voxel2mesh to display a voxel array as a malab figure

TINY FUNCTIONS:

these are tiny snippets (just a few lines) that really don't do very much but do save a bit of repetitive typing. These were nuisance enough for me at one point to make them into functions

isoSwitch - switch the 1st and 2nd column of vertex coordinates (x, y) in an FV struct. For some reason, x and y coordinates are switched when using the isosurface function to create a triangulated mesh from a binary image (bw matrix), with respect to the original image. These three lines switch them back (aligning the mesh and original image)

findIdx - returns xyz index of voxels > 0 as Nx3 matrix

sortedKmeans - performs kmeans on 1D data and assigns IDs so that ID = 1 has the largest ('descending') or smallest ('ascending') centroid value, ID = 2 the second largest etc

인용 양식

J. Benjamin Kacerovsky (2024). usefulSnippets (https://github.com/JBKacerovsky/matlabSnippets/releases/tag/v1.1.0), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2019b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Scalar Volume Data에 대해 자세히 알아보기
태그 태그 추가

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
1.1.0

See release notes for this release on GitHub: https://github.com/JBKacerovsky/matlabSnippets/releases/tag/v1.1.0

1.0.2

.

1.0.1

more snippets and description addedd

1.0.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.