Skip to main content
3-Newcomer
October 22, 2026
Question

Addition of two columns within a matrix

I have inserted a table from excel and i now want to add the values from two of those columns together, but i keep getting the error value must be a scalar or matrix. 

 

    5 replies

    21-Topaz II
    October 22, 2026

    Could you upload a zip file of the worksheet?

    Translate
    3-Newcomer
    October 22, 2026

    I have inserted a screenshot here thanks. 

    Translate
    Werner_E
    25-Diamond I
    October 22, 2026

    Its hard to impossible to debug just a picture!

    Are you sure that ALL 112 entries in column 6 and column 11 are numerical scalar values and that not a single one of them is a string or a vector or something else?

    Translate
    21-Topaz II
    October 22, 2026

    Hi,

    Where you add the columns 6 and 11 together the ORIGIN=0 by default so columns are numbered 0 to 10.  Column 11 does not exist.  Hence the error.

    Then you add ORIGIN=1 and columns are numbered 1 to 11 so you have column 11.

    Simply move ORIGIN=1 to above the summation of the two columns.

    Cheers

    Terry

    Translate
    Werner_E
    25-Diamond I
    October 23, 2026

    Then you add ORIGIN=1 and columns are numbered 1 to 11 so you have column 11.

    Its just an evaluation to show the value of ORIGIN, not an assignment. So I assume that ORIGIN is set to 1 right from the start (either via the menu option or via an assignment).

    Furthermore ​@CT_14725667  wrote that the error is “value must be a scalar or matrix”. Inconsistent ORIGIN-setting would yield a different error message.

    I also wonder why in the various submatrix commands ​@CT_14725667  consequently omits the last row of the 112 rows the matrix consists of. 

    It seems that he/she is using a worksheet as a template in which ORIGIN was left set to zero, and in that case, the range from 0 to rows(...)-1 would be correct for the complete vector encompassing all rows.

    But I can only emphasize once again that it's quite difficult to find errors when you're only shown a screenshot...

    Translate