zenterix

400 Reputation

5 Badges

2 years, 363 days

MaplePrimes Activity


These are questions asked by zenterix

I have a variable with the unit Volt.

I'd like to print something like "The voltage is %f" where the floating point is the value of the variable with the unit.

I've tried the options below so far.

How would one accomplish this?

with(Units:-Simple)

NULL

x := 5*Unit('V')

5*Units:-Unit(V)

(1)

printf(x)

Error, (in fprintf) format string expected

 

printf("%f", x)

Error, (in fprintf) number expected for floating point format

 

printf("%d", x)

Error, (in fprintf) integer expected for integer format

 

printf("%a", x)

5*Units:-Unit(V)

 

printf("%A", x)

5*Units:-Unit(V)

 

printf("%q", x)

5*Units:-Unit(V)

 

printf("%v", x)

5*Units:-Unit(V)

 

printf("%P", x)

                               5 Units:-Unit(V)

 

print(x)

5*Units:-Unit(V)

(2)

print(The*voltage*is, x)

The*voltage*is, 5*Units:-Unit(V)

(3)

print(The*voltage*is*x)

5*The*voltage*is*Units:-Unit(V)

(4)

NULL

Download PrintUnits.mw

int(1/(x*exp(x)), x)

-Ei(1, x)

(1)

int(1/(x^2*exp(x)), x)

-1/(x*exp(x))+Ei(1, x)

(2)

NULLNULL

What is Ei1 in Maple?

Download Ei1.mw

I have the following procedure

export exportCsvMatrix := proc(m:: Matrix, fileName: string)

  ExportMatrix(fileName, m, target=csv):

end:

However, I would like to be able to pass a list of matrices as well.

How can I add a parameter type that is Matrix or list of Matrix?

I have a very difficult time finding things in the documentation.

I would like to see documentation for `<,>` and `<|>`, as in `<,>`(1,2,3,4).

If I write ?<|> in Maple I get

If I do ?<,> I get

However, there is no mention of the usage of the backticks.

Finally, if I do ?`<,>` I get

No mention of the use of `<,>`. I only know about this from a previous reply to one of my questions and now I have forgotten the details so I am trying to look it up but it's hard to find.

I just spent 5h trying to figure out why when I return a table from a procedure defined in an .mpl file, and then execute that procedure in a worksheet, I can't access the table entries by using regular ol' bracket notation.

I can see the keys and values by using indices and entries and passing in the return value of the procedure, but that's it.

I have tried using eval, and I have even tried reproducing my use case in a simpler worksheet to try to isolate the issue but the issue doesn't appear. I am working in an .mpl file within a larger Maple project. I have read about last name evaluation, and have tried using eval with a numeric second parameter. Nothing works.

The file is very small and contains one single procedure, and it doesn't import any other file.

When I get the return value from my procedure and print it out all I see is the name of the original table defined in the procedure and the subscript I am trying to access, but not the data.

Maddening. 

4 5 6 7 8 9 10 Last Page 6 of 20