Hi I am new to Mathcad Prime and I'm trying to solve a kinematics problem, and I really need help. I want to multiply 3 nested arrays, but in step 4 I encountered the error "These arrays elements must be scalars. They cannot be vectors or matrices." I suspected it was because they are nested arrays, so I tried to convert the nested array H1 into a matrix with a code I found online and now I encountered the error "This value must be a vector,"
Any help is appreciated
Thank you
Solved! Go to Solution.
Chances are that @StuartBruff has a recursive utility function 'unnest' in his toolbox which can convert your nested matrices to regular 3x3 matrices,
But maybe its better to create H1,2,3 right from the start as 3x3 matrices:
Chances are that @StuartBruff has a recursive utility function 'unnest' in his toolbox which can convert your nested matrices to regular 3x3 matrices,
But maybe its better to create H1,2,3 right from the start as 3x3 matrices:
@Werner_E wrote:
Chances are that @StuartBruff has a recursive utility function 'unnest' in his toolbox which can convert your nested matrices to regular 3x3 matrices,
But maybe its better to create H1,2,3 right from the start as 3x3 matrices:
You rang?
Yes, I'm sure I do have a unnest function lying around, possibly several. Although the problem looks specifically like it would be suited to one my block/unblock matrix functions. I shall add it to my list of things to look for. It would be nice to have some means of looking inside an .mcdx worksheet and searching for terms in Windows Explorer or some such.
However, this case suggests that a tailored function that allows the best of both worlds.
The replacement submatrix defined below is one that I find more generally useful than the built-in version. After a decently short time, the brain gets used to the negative indices and it save a lot of typing and thinking when doing standard operations such as extracting complete rows or columns. I believe that every matrix or vector function should have a vector/matrix counterpart, hence subvector.
Stuart