The subsasgn Method
Class: kwave.toolbox.GridInput Package: kwave.toolbox
Overloaded assignment method to manage interactions with virtual properties.
Syntax
obj = subsasgn(obj, S, value);
Description
The subsasgn method has been overloaded to enhance interactions with the virtual properties of the kwave.toolbox.GridInput class. These virtual properties present users with an intuitive view of the non-padded grid, while internally the actual stored properties include the grid padding essential for k-Wave simulations.
When users assign a value to one of these virtual properties, this method validates the data, ensures it aligns with the grid size using the Grid object, and then maps the assignment to its internally stored, padded counterpart. If the targeted property is not a virtual property, the method falls back to MATLAB's default subsasgn operation.
Input Arguments
obj- (kwave.toolbox.GridInput) Instance of the GridInput class.S- (struct) MATLAB structure specifying the target property and type of assignment.value- (various) The data to be assigned. Its attributes are validated if the target is a virtual property.
Output Arguments
obj- (kwave.toolbox.GridInput) The GridInput class instance, updated with the new assignment, whether it was to a virtual or a standard property.