Closed rvuchkov closed 3 years ago
The entrywise subsasgn was not implemented originally since both the subsasgn overloading in Matlab, and the operation in general (which increases TT ranks by 1) are inefficient. It's always more robust to manipulate TT cores directly. However, someone has indeed added the elementwise subsasgn to tt_matrix. If you need to change only 1 or 2 elements, that should be fine. You can cast ttm = tt_matrix(ttt, ttt.n, 1), assign an element in ttm(i,1), and cast it back ttt = tt_tensor(ttm).
Thank you, yes indeed I am trying to change only one entry to deal with a boundary/ source condition in an application.
Hi after a some experimentation and reading the literature, I know we can do one-element MATLAB-style and subsassgn now possible for tt_matrix pretty easily something like
t(1,2) = 66
but do we have a similar way to change one element of the tensor? I know we reference and pull to see it say by knowing the indexing "entry = t(1,1,1,1)" but if can we edit it as well like before "t(1,1,1,1) = 66" or in some other way?
Thank you for the help in advance!