mongrel73

132 Reputation

4 Badges

16 years, 247 days

MaplePrimes Activity


These are questions asked by mongrel73

Ok, I've got a matrix where the elements are lists of length 3, the first element tells you what sort of entry it is; the important thing to know here is that if the first entry is one then the second entry (and third) is a variable.

Ok I have already defined f as a procedure earlier on, so here is where i am having a problem:

 

Basically what I would like to do, which seems self-explanitory but is obviously not in the right language for maple is this (this is for a local M within a procedure where P is a matrix already defined).

TemplateMatrix:=proc(P) local M;
M:=Matrix(3, if P[i,j]=1 then (i,j)->x[i,j] else (i,j)-> P[i,j]);
M
end proc;

basically what i'm trying to do is turn P which is currently just a matrix of numbers into a matrix which has variables where the number 1 was previously an entry.
 

yes, basically i just want to call something "y at x=0", just to make the final presentation of my results better. Is there something similar to # that will stop maple getting confused by the space of the equals sign, and just ignore it as comment/description?

This is mainly an aesthetic thing, but I'm finding an interpolating quartic polynomial given some data points, so I set up a Matrix system of linear equations etc, but I want the output solution vector (i.e. the solutions for the coefficients of x, x, x, etc.) to be to 3sf. I have tried putting evalf[3](LinearSolve(A,b)); but that doesn't seem to work. Even if I change Digits, (which isn't ideal anyway as I only want output to be to 3sf temporarily) the values in the vector solution are still to 10sf.

1 2 Page 2 of 2