Skip to main content
1-Visitor
February 16, 2020
Solved

custom CreateMesh function of vector argument

  • February 16, 2020
  • 1 reply
  • 1807 views

I`m trying to create function CreateMesh.f which works with vector argument but I met some problems

CreateMesh for vector argument.png

EDIT: I found the way, but I don`t understand why the first one doesn`t work

Workaround.png

Best answer by Werner_E

Mathcad/muPad does not know that your {x} should be a two-element vector unless you provide a two-element vector (x,y) instead of a single variable name. Thats why your first attempt fails and the second succeeds.

Furthermore "CreateMesh" is a numeric command only - its not known by the symbolic processor.

Your second approach does not use symbolics and to me its much more clearer and straight forward anyway. I would prefer it even if the first one would work 😉

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
February 16, 2020

Mathcad/muPad does not know that your {x} should be a two-element vector unless you provide a two-element vector (x,y) instead of a single variable name. Thats why your first attempt fails and the second succeeds.

Furthermore "CreateMesh" is a numeric command only - its not known by the symbolic processor.

Your second approach does not use symbolics and to me its much more clearer and straight forward anyway. I would prefer it even if the first one would work 😉

25-Diamond I
February 16, 2020

BTW, here is a modification of your first approach using symbolics, but as already written, I still would prefer your second approach.

Werner_E_0-1581879261246.png