cellsize

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.3, Creation date: 2018-10-30, Last change: 2025-09-14

returns the size of cell elements



See Also:

Example Illustration

 missing image of cellsize(C);

Syntax

cs=cellsize(C);

Input Parameter

C): cell array

Output Parameter

cs: size of array

Examples


loadweb JACO_robot.mat;
FS=FSofSG(JCF), size(FS)
cellsize(FS)
cellsize(FS')
cellsize({[1 ],[3 2] [2 3 1] [2]})




Copyright 2018-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This algorithm is a MATLAB function named cellsize that calculates the size of each element within a cell array. It is part of the SolidGeometry library and was introduced in version 4.3.

Input Parameters

Output Results

Algorithm Explanation

The function begins by initializing an array cs with zeros, having the same size as the input cell array C. This is done using the zeros function, which creates an array of zeros with dimensions matching C.

The function then enters a for loop that iterates over each element of the cell array C. The loop runs from 1 to the total number of elements in C, which is determined using the numel function.

Within the loop, the function calculates the number of elements in each cell of C using numel(C{i}) and assigns this value to the corresponding position in the cs array. This effectively stores the size of each cell element in cs.

After the loop completes, the function returns the cs array, which contains the sizes of all elements in the input cell array C.

Example Usage

The function can be used as follows:

Algorithm explaination created using ChatGPT on 2025-08-18 22:14. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21