Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
I am trying to write a code in Mathcad Prime 9.0 to make a K matrix by making the K0 matrix of zeroes populate with k matrix numbers as shown below and in the file attached. If anyone could please help me with the Mathcad code for that it would be much appreciated! (P.S. I do not have any experience with coding therefore I am not even sure where to start)
Here is my mathcad:
This is what the K matrix should look like and it should be able to work for any n value
Solved! Go to Solution.
@ReedzBeedz wrote:
... as shown below and in the file attached.
Unfortunately you had not attached your Prime file!
You also did not explain the algorithm used to create the K-matrix so I had to make a guess just based on the one example you show.
You have to modify it if the actual algorithm used is differently.
Here is a way to create the matrix K you are looking for (no need to create an all-zero matrix beforehand):
It works for vectors h and I of any (equal) length with the only limitation hat the vectors must have at least two elements.
You may also turn the calculation into an utility function as you did for the k-values (which as you can see can be calculated much easier in one go).
I made the function ORIGIN-aware so you could use it unchanged also in sheets with different ORIGIN setting and I show a rudimentary error check.
Prime 9 file including a few additional remarks is attached
@ReedzBeedz wrote:
... as shown below and in the file attached.
Unfortunately you had not attached your Prime file!
You also did not explain the algorithm used to create the K-matrix so I had to make a guess just based on the one example you show.
You have to modify it if the actual algorithm used is differently.
Here is a way to create the matrix K you are looking for (no need to create an all-zero matrix beforehand):
It works for vectors h and I of any (equal) length with the only limitation hat the vectors must have at least two elements.
You may also turn the calculation into an utility function as you did for the k-values (which as you can see can be calculated much easier in one go).
I made the function ORIGIN-aware so you could use it unchanged also in sheets with different ORIGIN setting and I show a rudimentary error check.
Prime 9 file including a few additional remarks is attached
Hello, thank you very much for your help this is exactly what I needed! Sorry about not attaching the file I must have missed that. Also, sorry about not explaining as much as I should have, I am very new to Mathcad and programming things in it so I wasn't sure how to explain.
Thanks again!