0
Fixed

Error using mp/subsasgn: Subscripted assignment dimension mismatch.

Jon Vegard 1 year ago • updated by Pavel Holoborodko 1 year ago 7

The following subscript assignment works fine in MATLAB, but not with the MP-toolbox. Obviously workaround exists, but this type of assignments are truly convenient.

A = zeros(3,3,3);
B = ones(3,1);
A(1,1,:) = B;

A = zeros(3,3,3,'mp');
B = ones(3,1,'mp');
A(1,1,:) = B;

Fixed

Thank you very much for your report on this important issue!

We have just fixed it. Please upgrade to newest version of toolbox - 4.4.4.12672.


Would highly appreciate further feedback.

Please, put the new release note always on your version history page! Other users does not read all notes on this forum.


Same problem on Linux release 4.4.4 Build 12666. When will be available the Linux version of this release?

Hi, it works fine now.

When I use a parfor-loop instead of a for-loop the accuracy is (some times) reduced to quad precision (the same thing occurs when I am using the symbolic toolbox with the vpa() function). When I tried to create a minimal working example, I failed to reproduce the phenomena (my code is quite large). I guess I could investigate this in detail to find the problem, but this issue might be known to you?


Best,
Jon Vegard

+1

Every instance of MATLAB loads independent copy of toolbox with default settings (precision, etc.).

Thus, precision should be set up globally, using global settings file - see the mpstartup.m script in toolbox directory.


Also please check the mp.NumberOfThreads setting in the script and how to use it for optimal performance with "parfor".

Under "MATLAB instance" I mean the worker in "parfor". MATLAB spawns the required number of  workers automatically. Each of them with its own set of toolboxes, etc.

Thanks, that made sense and it works like a charm now.

Thanks again for impressively quick replies and fixes.