I appreciate the help with solving my problem, though I do have some comments/questions to make with regard to usability for new users:
Why can't matrices be allowed in SR in a nontrivial way? Or, for some function H(s), why cant the behavior H(1) = H(s=1) be the default behavior? I guess my issue is that there doesn't seem to be a simple/consistent way to define a function that works, and I believe there should be. Mathematica manages this functionality somehow, what makes it difficult here? I am certainly a fan of using lambda functions, but iirc they are from python and are not inherently Sage/mathematical objects, right? Lambda functions aren't the "suggested" way to make functions in the Sage tutorial. Perhaps it is just not known to me, but I would love for there to be some *simple* consistent standard with defining functions such that, if I define one in this way and try to plot it or plug in values with a certain notation, it will Always work and not give me something weird like this. Does such a consistent notation exist that I haven't seen? The page "Some Common Issues with Functions" in the documentation essentially comments on the existence of this issue. Thanks for all of the help so far, I appreciate it! On Friday, November 30, 2018 at 4:59:40 PM UTC-5, saad khalid wrote: > > Hi all, > > I'm not sure what is happening, but I defined some matrices: > Mz = matrix([[0,1],[1,0]]) > Mx = matrix([[1,0],[0,-1]]) > M1 = matrix([[1,0],[0,1]]) > > And then I tried defining a function where I multiply these matrices by > some variable and add them together: > > h(s) = M1 + s*Mx > h(.1) > However, when I try to compute this h(.1), the function doesn't plug in .1 > in for s in the function, and it returns: > > [ s + 1 0] > [ 0 -s + 1] > > > What exactly is happening? > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.