|
121 | 121 | disp('Warning: Writing Float data to an Integer DataArray');
|
122 | 122 | end
|
123 | 123 |
|
124 |
| - errorStruct.identifier = 'DataArray:improperDataType'; |
| 124 | + err.identifier = 'DataArray:improperDataType'; |
125 | 125 | if (islogical(obj.read_all) && ~islogical(data))
|
126 |
| - errorStruct.message = strcat('Trying to write', ... |
127 |
| - 32, class(data), ' to a logical DataArray.'); |
128 |
| - error(errorStruct); |
| 126 | + m = sprintf('Trying to write %s to a logical DataArray', class(data)); |
| 127 | + err.message = m; |
| 128 | + error(err); |
129 | 129 | elseif (isnumeric(obj.read_all) && ~isnumeric(data))
|
130 |
| - errorStruct.message = strcat('Trying to write', ... |
131 |
| - 32, class(data), ' to a ', 32, class(obj.read_all), ... |
132 |
| - ' DataArray.'); |
133 |
| - error(errorStruct); |
| 130 | + m = sprintf('Trying to write %s to a %s DataArray', class(data), class(obj.read_all)); |
| 131 | + err.message = m; |
| 132 | + error(err); |
134 | 133 | elseif (ischar(data))
|
135 | 134 | %-- Should actually not be reachable at the moment,
|
136 | 135 | %-- since writing Strings to DataArrays is not supported,
|
137 | 136 | %-- but safety first.
|
138 |
| - errorStruct.identifier = 'DataArray:unsupportedDataType'; |
139 |
| - errorStruct.message = ('Writing char/string DataArrays is not supported as of yet.'); |
140 |
| - error(errorStruct); |
141 |
| - else |
142 |
| - fname = strcat(obj.alias, '::writeAll'); |
143 |
| - nix_mx(fname, obj.nix_handle, nix.Utils.transpose_array(data)); |
| 137 | + err.identifier = 'DataArray:unsupportedDataType'; |
| 138 | + err.message = 'Writing char/string DataArrays is currently not supported.'; |
| 139 | + error(err); |
144 | 140 | end
|
| 141 | + |
| 142 | + fname = strcat(obj.alias, '::writeAll'); |
| 143 | + nix_mx(fname, obj.nix_handle, nix.Utils.transpose_array(data)); |
145 | 144 | end
|
146 | 145 |
|
147 | 146 | function r = datatype(obj)
|
|
0 commit comments