MapleUser2017

175 Reputation

6 Badges

7 years, 173 days

MaplePrimes Activity


These are questions asked by MapleUser2017

Hi there, 

 

I am trying do to a solve procedure, so you can solve an equation using the following argument. 

Solution(eqn, value, var) which uses the embedded solve command. 

When is an integer it works fine with this code here. 

MySolution:=proc(xl::algebraic,is::integer, x::algebraic)
return solve(xl=is,x);
    end proc; 

However the problem arises when I will like to make it to recognize is a an decimal number aka float. 

MySolution:=proc(xl::algebraic,is::integer, x::algebraic)
    return solve(xl=is,x);
    if type(is,float) then
return solve(xl=is,x);
    end proc; 

Any idears on what I am doing wrong? 

Many thanks in advance and have a nice day.

I am trying to construct a procedure which makes a boxplot from a list using the statistics package. 

I have come to this here. However it shows both the x and y - axis. Is there any way to make it show a horizontal boxplot like in my code. But only displays the x- axis ? Meaning the values from the plot? Plus any to make it not stick to x-axis like my code does? I tried the command scale, but it doesn't work in statistics package 

    BoxP:=proc(xd::list) 
        uses Statistics:
        return plots[display](BoxPlot(xd,deciles = false,orientation=horizontal),size=[600,400],axes=normal);
    end proc;

I am trying to do a small procedure which converts an input of degrees into the sin function into its corresponding unit-circle value. I can get this to work. 

Sinus:= proc(g::unit)   
return evalf(sin(g*Pi/180));
end proc; 

 

but is there a more elegant way to do it? Using maybe Units package ? Thanks in advance :)

Dear Maple Users, 

 

First of all I would like to thank for your great support and hints on making a package for Maple. It has made possible for me to construct this package here: 

 

restart; 
MyMat:=module()
description "My Package";
option package; 
export RegModelPlot,RegModel;
RegModelPlot :=proc(c::algebraic,xd::list,yd::list,x::algebraic)
    uses Statistics, plots:
     display
                            (  [ plot
                                 ( Fit(c, xd, yd, x),
                                   x=min(xd)..max(xd),
                                   color=blue,gridlines,
                                   title=typeset("Regressionformula\n f(x) = ", evalf[4](Fit(c, xd, yd, x))),caption=typeset("Residuals = ", Fit(c, xd, yd, x, output = residuals) ))                    
                                 ,
                            
                                 plot
                                 ( xd, yd,
                                   style=point,
                                   symbol=solidcircle,
                                   symbolsize=10,
                                   color=red
                                 )
                               ],
                               size=[800,600]
                            );
                           
                           end proc; 

    RegModel:=proc(c::algebraic,xd::list,yd::list,x::algebraic)
            uses Statistics, plots:
return  Fit(c, xd, yd, x);
end proc; 
    end module

 

My question is now. How do I make it installable ? Meaning, making it so I can be accessed using with the with() argument alene? I have tried to convert it to into an MLA-file and place it in the lib folder. 
 

But if I type with(MyMat) it gives me the error: 

Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received MyMat 
 

So anyone with an idea/hint on what I need to add to make the package installable? 

 

Thanks in advance :)

I am fairly new to programming i Maple. I am trying to constuct a package which takes two list xlist, ylist, and using the imported Fit commands from the statictics package, tries to do line fitting. 

What am I missing to get this to work? :) 



Mat:=module()
    description "My Package";
    option package;
    Statistics(Fit);
    export LinModel; 
    LinModel :=proc(xliste::list, yliste::list,x::algebraic, $)
        return Fit(xliste,yliste,x)
        end proc; # LinModel 

    end module; #Mat

5 6 7 8 9 Page 7 of 9