0
Fixed

Error using mp/subsasgn: Subscripted assignment dimension mismatch.

Jon Vegard fa 7 anys updated by Manolis Chatzis fa 3 anys 13

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.

Hello,

Similar error for the following lines:
DXKX0=eye(length(X(1,:)),'mp');

DXX0(1,:,:)=DXKX0;

Error using mp/subsasgn (line 1387)
Subscripted assignment dimension mismatch.

Under review

Could you please provide minimal, complete, and verifiable example, so that situation can be reproduced?
Please check the top post on the forum homepage: https://mct.userecho.com/

Sure, 

The following two lines should result in reproducing the error:

DXKX0=eye(3,'mp');

 DXX0(1,:,:)=DXKX0;

Fixed

Great, thank you for the report!


We have just released updated version of toolbox for Windows. It includes bug fix for this issue among other improvements.

Please download it from our homepage (download trial) or just use this link: https://bit.ly/2XwTWH7

Don't forget to copy your license key to the folder of new toolbox version!


Would appreciate if you would test your code with new toolbox and let me know the results. 

We will release Linux & Mac OS versions soon.

Thank you for the fast reply. Yes the new version has resolved this.