Encoding scalar values into array unnecessarily
wrgrant opened this issue ยท 1 comments
Last one (for now) ๐
I notice that in this line you are packing scalar values into an array.
But only for floats. Integers don't do this.
Is this a bug or is this expected behavior?
With the current behavior, I end up with interesting data results such as this attached image (after pulling into JavaScript). Note, the single integer is placed directly as a scalar, while the single float value is packed into a single element array.
I found that changing the float encoding line to:
txt=D_(mat,varargin{:});
yielded what I expect to be correct results.
But I'm curious if there is some other design decision that this change would break?
sorry, did not pay attention to my notifications until now.
I agree this is an inconsistency in the code. I believe this was more of a historical reason why it was written this way.
I made the above commit and it should now output single float value if the SingletArray
flag is 0 (default).
let me know if this patch works for you