isemptycell

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.9, Creation date: 2020-07-27, Last change: 2025-09-14

similar to isempty but works with cells



See Also:

Example Illustration

 missing image of isemptycell(A)

Syntax

e=isemptycell(A)

Input Parameter

A: cell

Output Parameter

e: logical list

Examples


A=SGsample(20), isemptycell(A)




Copyright 2020-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 function, isemptycell, is designed to determine if elements within a cell array are empty. It extends the functionality of the standard isempty function to work with cell arrays.

Input Parameters

Output Results

Algorithm Steps

  1. Check if the input A is a cell array using iscell(A).
  2. If A is not a cell array, use the standard isempty function to determine if A is empty and return the result.
  3. If A is a cell array, initialize a logical array e with the same size as A, filled with false.
  4. Iterate over each element of the cell array A using a for loop.
  5. For each element A{i}, recursively call isemptycell to determine if it is empty.
  6. Check if the result ei from the recursive call is a scalar. If not, throw an error indicating a mix of subsets with different sizes.
  7. Assign the result ei to the corresponding position in the logical array e.
  8. After the loop, return the logical array e.

Example

To use the function, you can create a sample cell array using SGsample(20) and then call isemptycell(A) to check which elements are empty.

Algorithm explaination created using ChatGPT on 2025-08-18 22:26. (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