mmcdara

7022 Reputation

18 Badges

8 years, 229 days

MaplePrimes Activity


These are questions asked by mmcdara

Suppose you do this

save something, afile.m;

and that later someone else does this

read afile.m;

Let's assume that this person does not know the names of the variables you have saved.
A way to get these names could be

before := { anames('user') };
read file.m:
after := anames('user') minus before minus {'before'}


I thought after would only contain something, but it also contains all the elements of before, just as if  
anames('user') minus before was not effective (see PS below)
Exemple

restart:
interface(version)
Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 

   21 2015 Build ID 1097895
a:=1:
before := {anames('user')};
                              {a}
b:=2:
after := {anames('user')} minus before minus {'before'}
                         {a, b}



How can I obtain the set of the new user-asigned names?

PS: Why does displaying  before give the value assigned to and not a itself?

before
                              {1}



Thanks in advance

Hi,

If I use a package  that I don't wnt to load, is these two is the best way to proceedcontains

  • alias (P= package): 
  • macro (P= package):
     

Thanks in advance

Hi, 

Here is my first attempt to work with Embedded Components.
I loaded the "Bezier curve" example ("how to drag points") and the "Linear Regression" one ("how to add points") from the MathApps, merge the codes and modified them in order to draw a polygon with an arbitrary number of sides.

After many unsuccessful attempts I begin to understand the mogic behind Embedded Components (I'm familiar with Maplets and I'm sure this didn't help me).
For now , I am able to define points, drag them, and erase everything. A small step for Mankind but a huge step for me.

What I would like to do now is to erase some points.
The basic code is 

# Plot1 is the PlotComponent
# The list of the points is pt
#
# x0 and y0 are the co-ordinates of the point to remove from pt
# _removing is the number of the point in pt closest to (x0, y0)
#
# Update is the procedure which does the plot in Plot1

Remove := proc()
     x0 := DO(%Plot1( "clickx" ) );
     y0 := DO(%Plot1( "clicky" ) );
     d := map(n -> add((pt[n]-~[x0, y0])^~2), [$1..nops(pt)]):
     _removing := sort(d, output=permutation)[1];
     subsop(_removing=NULL, pt);
     Update();
end proc;

Unfortunately I don't understand well enough the logic of  Embedded Components to make this work

Can you help me fix this?
TIA

sketch.mw

PS: In procedure Update I define two plots named fond (=background) and grille (=grid): grille is a workaround to "toggle gridlines" or 'gridlines'=true for none of these options work for me (Maple 2015.2, Mac OSX Mojave)

Hi, 
I just realized inadvertently that it was possible to edit a reply even if you were not the author (mmcdara is my personal account and sand15 my professional one and I modified under the former a reply I'd made with the later).

To be sure of that I've modified the last @acer's answer here 232397-Plotting-Multiple-Vectors-On-One-3D--Graph

You could show us what you've got so far

is now

You could show us what you have got so far

(I hope @acer will excuse me)


I think this is a weakness of Mapleprimes for no one should be allowed to change what others have written.

Hi,

I would like the display of a piecewise-function F with DocumentTools:-Tabulate to look like the one I get with print.
How is it possible to do this?

Here is an example

restart:
with(DocumentTools):
with(DocumentTools:-Layout):

MV := kernelopts(version);
Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895

# Extract the version number for subsequent use
MV := parse(substring(StringTools:-Split(convert(MV, string), ",")[1], 7..-1))

# I want to display F and G while using DocumentTools
# As you see the display of F is not very pretty.
# This is not a problem related to the "height" of the formula for G is pretty-displayed
# even if it as roughly the same "height" than F

F := piecewise(seq(op([x<k, k]), k=1..5)):
g := x -> 1/(1+x):
G := (g@@5)(x):
Tabulate([F, G]):

# using DocumentTools:-Layout doesn't help

C1 := Cell( Textfield(style=TwoDimOutput,Equation(F))):
C2 := Cell( Textfield(style=TwoDimOutput,Equation(G))):
T  := Table(Column(),Column(),
         Row( C1, C2 )
       ):

if MV < 2018 then
  InsertContent(Worksheet(Group(Input( T )))):
else
  InsertContent(Worksheet( T )):
end if;


This is what DocumentTools:-Tabulate displays


DocumentTools_piecewise.mw


TIA

First 17 18 19 20 21 22 23 Last Page 19 of 45