On 1/25/25 19:05, Sid Andal wrote:
Let
M : Matrix(INT) := [[10, 20], [30, 40]]
I'd like to output to screen a particular entry, e.g. 2nd row, 1st col,
of matrix M which is equivalent to the following C statement:
printf("\n\tM(%d, %d) = [%d]\n\n", 2, 1, M(2, 1));
Dear Sid,
Maybe I do not fully understand what you want, but maybe the following
is of any help to you...
Ralf
M := matrix([[10, 20], [30, 40]])$Matrix(Integer)OF ==> OutputForm
LOF ==> List OF
disp(x) ==> display((x::OF)::Formatter(Format1D))
o x ==> x :: Symbol :: OF
d l ==> disp hconcat(l)
tab ==> o((char(9)$Character)::String)
pr(i,j,m) ==> d([tab, o "M(", i::OF, o ",", j::OF, o ") = [",
m(i,j)::OF, o "]"]$LOF)
for i in 1..2 repeat for j in 1..2 repeat pr(i,j,M)
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/22ec7e79-6f65-408c-b57c-224b44666c88%40hemmecke.org.