Lana

50 Reputation

3 Badges

0 years, 245 days

MaplePrimes Activity


These are replies submitted by Lana

@acer 
That's a great approach, thanks a million!

@tomleslie 

Your approach is indeed simpler and it's a good objection.
The reason for the strings and parsing in my case is that the code will be used in a learning platform where objects get passed as strings - sorry for not clarifying these restricitons right away.
Anyhow, I appreciate the insight about how this can be done with no such limitation :-) 

@acer 
Appreciate the remark! Active operations within the Vector are indeed welcome. 
I also tried to achieve the same effect when Vectors are given using angle brackets - turns out a bit of extra care is needed:

Str := "1/3*<3^(1/2), -3^(1/2), 3^(1/2), 0> -1/3*<3^(1/2), 3^(1/2), 3^(1/2), 0>+ <2,1,1,0>":
Set := {op(InertForm:-Parse( Str ))}:
Set := subsindets(Set, specfunc(`%\`<,>\``), value):
Set := eval({op}(Set),  `\`<,>\``= `<,>`);

@vv @acer
That's great to know, thank you both for the insights! I always used the exact values, so this ´discrepancy´ caught me off-guard.

@dharr 

selectremove does the trick! Thank you!

Page 1 of 1