## 439 Reputation

14 years, 314 days

## Yes, you're right....

@acer I haven't investigated it too much. I would also change the linecolor since the resulting line is yellow and it is pretty light.

## Yes, you're right....

@acer I haven't investigated it too much. I would also change the linecolor since the resulting line is yellow and it is pretty light.

## OK....

@Markiyan Hirnyk And what about computing the solution for radians and then transforming the argument to degrees?

## OK....

@Markiyan Hirnyk And what about computing the solution for radians and then transforming the argument to degrees?

## Confusing....

@Alejandro Jakubi Thank you for the link. However, I find this implementation a little confusing. For example you can use

without a space (and it works like if there was a multiplication), but it doesn't work in the reversed order.

Another thing: the space (with the multiplication meaning) doesn't work for decimals and integers, however, it works for fractions:

Error, missing operation

6

## Confusing....

@Alejandro Jakubi Thank you for the link. However, I find this implementation a little confusing. For example you can use

without a space (and it works like if there was a multiplication), but it doesn't work in the reversed order.

Another thing: the space (with the multiplication meaning) doesn't work for decimals and integers, however, it works for fractions:

Error, missing operation

6

## collect...

For example with

collect(%, {x, y}); # add it after the DotProduct command

You can actually get the same equation even with the first suggestion, but this is better.

## collect...

For example with

collect(%, {x, y}); # add it after the DotProduct command

You can actually get the same equation even with the first suggestion, but this is better.

## local variable, function definition...

1) You declared x as a local variable in your proc and you returned some sequence using this local variable x. Then you tried to create a function combining the global variable x and the mentioned sequence with the local variable x. So these x's didn't match. For this reason you could do two things:

a) declare x as a global variable in your proc (I didn't recommend this)

b) define the function right in your procedure (using unapply command)

2) There are two main ways how to define a function: arrow notation and using unapply. When you have an expression which needs to be evaluated when defining the function, you have to use ?unapply. Compare these two constructions of k:

a)

pwl := x < 0, -1, x < 1, 0, 1:
k := x -> piecewise(pwl);

k(-1/2);

b)

pwl := x < 0, -1, x < 1, 0, 1:
k := unapply(piecewise(pwl), x);

k(-1/2);
-1

## local variable, function definition...

1) You declared x as a local variable in your proc and you returned some sequence using this local variable x. Then you tried to create a function combining the global variable x and the mentioned sequence with the local variable x. So these x's didn't match. For this reason you could do two things:

a) declare x as a global variable in your proc (I didn't recommend this)

b) define the function right in your procedure (using unapply command)

2) There are two main ways how to define a function: arrow notation and using unapply. When you have an expression which needs to be evaluated when defining the function, you have to use ?unapply. Compare these two constructions of k:

a)

pwl := x < 0, -1, x < 1, 0, 1:
k := x -> piecewise(pwl);

k(-1/2);

b)

pwl := x < 0, -1, x < 1, 0, 1:
k := unapply(piecewise(pwl), x);

k(-1/2);
-1

## Imaginary unit....

Do you know that in Maple the imaginary unit is denoted as I?

## OK,...

@Markiyan Hirnyk thank you for the reference. I should search differently, I tried several keywords like "min index value" or similar and have found nothing.

## OK,...

@Markiyan Hirnyk thank you for the reference. I should search differently, I tried several keywords like "min index value" or similar and have found nothing.

## It works in Maple 13....

@anishtain4 What did you do?

When you change the line

to

return unapply(piecewise(pw), x);

then it works, in Maple 13 as well. With this change you can go on then like:

f := vec2pw(x1, d):
f(1);

-0.476000000

## It works in Maple 13....

@anishtain4 What did you do?

When you change the line

to

return unapply(piecewise(pw), x);

then it works, in Maple 13 as well. With this change you can go on then like:

f := vec2pw(x1, d):
f(1);

-0.476000000

 1 2 3 4 5 6 7 Last Page 3 of 15
﻿