Post Reply 
apply in the program [Solved]
12-22-2015, 05:03 PM (This post was last modified: 09-06-2016 11:37 AM by jrozsas.)
Post: #1
apply in the program [Solved]
The function apply(x-> x ^ 3, [1,2,3]) works when writing alone.
[Image: Bi88k.jpg] [Image: 2s8ew.jpg]
In a program can not display the result. Can you help me?
[Image: XeH4R.jpg]
EXPORT meusymp2()
BEGIN
LOCAL x,B,V,G,L;
INPUT(B,"DIGITE B");
INPUT(V,"DIGITE X");
INPUT(G,"DIGITE G");
L:=CAS.apply(x(x*3),[[B],[V],[G]]);
RECT;
TEXTOUT_P(L,120,30,2,#000000h,190,#99FF00h);
FREEZE;
END;

Leo

Visit this user's website Find all posts by this user
Quote this message in a reply
12-22-2015, 06:04 PM
Post: #2
RE: apply in the program
Here is a (simplified) structure that may be of some help(?)

Code:

EXPORT meusymp2()
BEGIN
  LOCAL x;                                         //  avoiding reserved variable issues
  RECT;

  M0:=[1,2,3];                                     //  Default values
  M1:=CAS.apply("x->x^3",M0);                      //  Uses matrix reserved variables
  
  TEXTOUT_P(M1,120,30,2,#000000h,190,#99FF00h);
  wait;                                            //  replaces FREEZE;

END;
Find all posts by this user
Quote this message in a reply
12-22-2015, 06:17 PM
Post: #3
RE: apply in the program
(12-22-2015 06:04 PM)DrD Wrote:  Here is a (simplified) structure that may be of some help(?)

Code:

EXPORT meusymp2()
BEGIN
  LOCAL x;                                         //  avoiding reserved variable issues
  RECT;

  M0:=[1,2,3];                                     //  Default values
  M1:=CAS.apply("x->x^3",M0);                      //  Uses matrix reserved variables
  
  TEXTOUT_P(M1,120,30,2,#000000h,190,#99FF00h);
  wait;                                            //  replaces FREEZE;

END;

Thanks DrD!
see :
EXPORT meusymp2()
BEGIN
LOCAL x,B,V,G,L;
INPUT(B,"DIGITE B");
INPUT(V,"DIGITE V");
INPUT(G,"DIGITE G");
M0:=[B,V,G];
M1:=CAS.apply("x->x^3",M0);
RECT;
TEXTOUT_P(M1,120,30,2,#000000h,190,#99FF00h);
WAIT;
END;
[Image: kEduk.jpg]

Leo

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)