Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Spline Interpolation


Spline Interpolation


I bought a book called Thermal Engineering Studies with Excel, Mathcad, and Internet, and I replicated a problem in chapter 1. 


I wondered if someone can point out what I am doing wrong because I'm not getting the answer. The message that I get is that the value must be a scalar or matrix. 


I also attached the file I was working on in Mathcad Prime 3.1.



Chapter 1 - Spline Interpolation.PNG


There are three errors in your sheet:


1) highlighted in yellow: You missed the argument "1+ORIGIN" in one of the submatrix commands

2) green arrows: You must use the column selector (Ctrl-Shift-C) here , not the power operator.

3) red arrows: these lines are 1 x 2 matrices but you created a 1x1 matrix with an implicit multiplication of an assignment and a string.

Basically Valery did this confusing thing to be able to place the comments beside the program lines. Thats the only reason for creating a matrix (by typing square brackets). For the program to work correctly only the assignment is necessary.

So you can replace the line

[X <- submatrix(.....)    "coment text"]

simply by

X <- submatrix(.....)

No square brackets, no text.

If you want to duplicate what Valery did, you would type the square bracket, then "X <- submatrix(.....)"  but then you press Shift-Space to create a second matrix column where you can type the comment string.


I myself prefer to put the comments on a line of their own before the command. That makes the program a little longer, but it's less confusing in my opinion. In the example you posted this would look like this:





I apologize for the fact that in the book I did not quite clearly describe the technique when on one line you can write several operators in a matrix with one row and several columns. I wanted the calculations in the book to be compact.