Open gsparks3 opened 1 month ago
Hi,
I agree that the behavior is not desirable. Unfortunately, I also do not oversee whether changing this behavior creates unintended bugs. As a workaround I would recommend to use vector3d.byXYZ(d)' whenever you have a Nx3 data matrix and
vector3d(d)` whenever you have a 3xN data matrix.
Ralf.
I noticed some inconsistent behavior in the vector3d constructor. I was considering trying to fix it myself, but I wanted to make sure that I didn't introduce any new bugs in the process ... pondering fixes, I think the case of a 3x3 input matrix might be an issue, since you can't unambiguously define whether the output should be a row or column vector solely from the shape of the input, unlike other N x 3 or 3 x N matrices.
Example of inconsistent behavior:
Expected result: If a 3 x N matrix produces a 1 x N vector3d, a N x 3 matrix should produce a N x 1 vector3d. However, a 3 x 3 matrix is ambiguous. Possibly best to have that case throw a warning or error.
What MTEX version do you use? MTEX 5.11.2