Skip to content

Commit 5431c8b

Browse files
committed
fixDataTypeErrors: add float to integer warning
1 parent cc8d3fc commit 5431c8b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

+nix/DataArray.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@
9292
%-- If a DataArray has been created as boolean or numeric,
9393
%-- provide that only values of the proper DataType can be written.
9494
function write_all(obj, data)
95+
if(isinteger(obj.read_all) && isfloat(data))
96+
disp('Warning: Writing Float data to an Integer DataArray');
97+
end;
98+
9599
errorStruct.identifier = 'DataArray:improperDataType';
96100
if(islogical(obj.read_all) && ~islogical(data))
97101
errorStruct.message = strcat('Trying to write', ...

0 commit comments

Comments
 (0)