0
Not a bug

Wrong display of arrays after vertical concatenation

Michael_ 5 years ago updated by Pavel Holoborodko 5 years ago 5
Hello.

There is a bug in the display of arrays after a vertical concatenation. (Matlab 2014b)

Example:

mp.Digits(34)
a=(1:100)';
b=mp(a(1:50));
c=mp(a(51:100));
d=[b;c];

If you view the variable d in the variable editor it shows the wrong numbers after the 65th entry. If you check it in the command window it is correct.
Under review
Confirmed. R2014a also has this issue.

The main issue here is that actually toolbox has no influence on variable editor functionality.
Looks like Matlab's bug. Will check further.

The bug is more interesting.
The issue repeats every 64 values (modulo 64).

Try for example:

a = (1:200)';
b=mp(a(1:100));
c=mp(a(101:200));
d = [b;c];
 
This "black magic" is definitely not related to toolbox :-). 
The bug is not appearing when simple double values are used.

Example:

a = (1:200)';
b=a(101:200);
c=a(1:100);
d = [b;c];

Since vpa values can't be viewed at all in the variable editor I can't use them for comparing in this issue. I don't know how you managed it to show mp values at all in the variable editor. :-)
As funny as it might seem - our toolbox has better integration with MATLAB compared to VPA :-).

We tap into some undocumented features to make MATLAB show the "mp" objects in variable editor.

Still, there is no control on how MATLAB does this in detail. MATLAB calls functions from toolbox to determine the dimensionality of "mp"-variable and its string representation (for display). All other "magic" is its responsibility.

The "mp" matrices and arrays clearly have correct dimensionality (nothing would work otherwise).
Conversion to string can be easily tested as well, by 'num2str' or 'display' functions.

That is why I conclude that bug is in MATLAB.
I believe they have some issues with handling custom types in variable editor (I see similar issues at many other places). Hope they will improve quickly.