Anthrazit

580 Reputation

11 Badges

2 years, 294 days

MaplePrimes Activity


These are questions asked by Anthrazit

Apparently a colon within a string causes some issues when generating a XMLElement.

Didn't find anything in Maple Help about that though.

with(XMLTools)

dummy := "NS-EN 1995-1-1, part 1-1, Section 6"

"NS-EN 1995-1-1, part 1-1, Section 6"

(1)

XMLElement(dummy)

_XML_Element(_XML_ElementType("NS-EN 1995-1-1, part 1-1, Section 6"), [], [])

(2)

dummy1 := "NS-EN 1995-1-1, part 1-1, Section 6: Ultimate"

"NS-EN 1995-1-1, part 1-1, Section 6: Ultimate"

(3)

XMLElement(dummy1)

Error, (in XMLTools:-XMLElement) element tag name `NS-EN 1995-1-1, part 1-1, Section 6: Ultimate' contains the namespace prefix `NS-EN 1995-1-1, part 1-1, Section 6', but there is no `xmlns' attribute

 

NULL

Download xmlns.mw

Is there any way to convert a variable name to a string?

In that example, the content of the variable is converted to string, not the name of the variable.


 

a := 2

2

(1)

convert(a, string)

"2"

(2)

NULL


 

Download convertstring.mw

Is there any equivalent to Excel function arctan2?

This function takes x and y values, and returns values from -Pi to +Pi. In that way one can easily get the x and y values of an angle with correct signs.

Are there any examples showing how to plot multiple items in one plot?

  • What I have started with is to put a Plot component in my sheet, so that I can use that by its name.
  • Next thing on the list was to generate different plot objects, by assigning each of them to a variable.
  • To plot the whole bunch, I collected all the items I want to plot in a list
  • And plotted them by SetProperty("MyPlotcomponent", value, display(plotlist))

I wonder if this is the best way to do it. Especially when adding more stuff afterwards, would it be possible to just add something to the plot component?

Do I need plot components at all?

What's the correct way of copying the current contents of a mutable object to a variable.

Apparently eval doesn't do the job.

aVectorList := [Vector(2, [1, 2]), Vector(2, [3, 2])]

[Vector[column](%id = 36893489518525866940), Vector[column](%id = 36893489518525867060)]

(1)

results := []

[]

(2)

AddVector := Vector(4)NULL

Vector[column](%id = 36893489518525846460)

(3)

for x in aVectorList do AddVector[1] := x[1]; AddVector[2] := x[2]; results := [op(results), AddVector] end do

AddVector[1] := 1

 

AddVector[2] := 2

 

[Vector(4, {(1) = 1, (2) = 2, (3) = 0, (4) = 0})]

 

AddVector[1] := 3

 

AddVector[2] := 2

 

[Vector[column](%id = 36893489518525846460), Vector[column](%id = 36893489518525846460)]

(4)

NULL

results := []

[]

(5)

AddVector := Vector(4)NULL

Vector[column](%id = 36893489518525840668)

(6)

NULL

for x in aVectorList do AddVector[1] := eval(x[1]); AddVector[2] := eval(x[2]); results := [op(results), AddVector] end do

AddVector[1] := 1

 

AddVector[2] := 2

 

[Vector(4, {(1) = 1, (2) = 2, (3) = 0, (4) = 0})]

 

AddVector[1] := 3

 

AddVector[2] := 2

 

[Vector[column](%id = 36893489518525840668), Vector[column](%id = 36893489518525840668)]

(7)

NULL

Download Mutable.mw

3 4 5 6 7 8 9 Last Page 5 of 19