Syntax
[PL,nsup]=PLsupplement(PL)
Input Parameter
PL : | | Point list with missing points given as [inf inf inf] |
Output Parameter
PL : | | Point list with interpolated points |
nsup : | | Number of interpolated / supplemented points |
Examples
This procedure is used in VLFLpprojectPL
Copyright 2012-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 designed to supplement a point list (PL) with missing points, which are represented as [inf inf inf]. The function interpolates between existing points to fill in these gaps.
Input Parameters
- PL: A point list where missing points are indicated by [inf inf inf].
Output Results
- PL: The updated point list with interpolated points replacing the missing ones.
- nsup: The number of interpolated or supplemented points added to the list.
Algorithm Steps
- Check if there are at least three non-missing points in the list. If not, issue a warning, return an empty list, and set nsup to 0.
- Initialize variables: n (number of points in PL), k (current index), and nsup (number of supplemented points).
- Iterate over each point in the list using a while loop:
- Increment the index k.
- If the current point is missing (i.e., [inf inf inf]), find the previous (s) and next (e) non-missing points:
- Decrement s until a non-missing point is found, wrapping around to the end of the list if necessary.
- Increment e until a non-missing point is found, wrapping around to the start of the list if necessary.
- Calculate the difference vector d between the points at s and e.
- Determine the number of divisions (nd) needed to interpolate between s and e.
- Calculate the incremental difference (dd) for each step of interpolation.
- Increment nsup by the number of interpolated points (nd - 1).
- Iterate from s to e, updating each missing point with interpolated values:
- Increment s, wrapping around if necessary.
- If s is not equal to e, update the point at s with the interpolated value.
Algorithm explaination created using ChatGPT on 2025-08-19 07:02. (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