Message Boards Message Boards


Export code that contains InputField as CDF format?

Posted 8 months ago
3 Replies
0 Total Likes

I have created a code in Wolfram Mathematica. I want it to be CDF file. I selected File-> CDF Export -> Standalone. I was told that the file doesn't work. I think it is because of InputField. It has to work for all functions.

Clear[f, der1]
     [{Row[{Framed[Style["Functions", Bold, White, 25], 
         Background -> Red, RoundingRadius -> 1
      Row[{"Type the function:   ", 
        InputField[Dynamic[f], Background -> LightYellow]}],    
      Row[{"Domain: ", 
        dom = Simplify[FunctionDomain[f, x, Reals]]}],     
      Row[{"Range: ", FunctionRange[f, x, y]}],
      Row[{"f[0] ", f /. x -> 0}],
      Row[{"f[x]=0 ", Simplify[x /. Solve[f == 0, x, Reals]]}],
      Row[{"First derivative ", der1 = Simplify[D[f, x]]}],  
      Row[{"Second derivative ", der2 = Simplify[D[f, x, x]]}],
      Row[{"First derivative = 0 ", 
        zeder = Solve[der1 == 0, x ]}],      
      Row[{"Function is increasing: ", Reduce[der1 > 0, x]}],
      Row[{"Function is decreasing: ", Reduce[der1 < 0, x]}],
      Row[{"Points of discontinuity: ", 
        dis = Solve[Denominator[Together[f]] == 0, Reals]}],
      Row[{"First derivative - points of discontinuity: ", 
        noder = Solve[Denominator[Together[der1]] == 0, Reals]}],
      Row[{"Extrema: ", 
        extr = Union[
          Sort[Join[{axisxfrom}, {axisxto}, {zeder}, {noder}, \
      Row[{"Maximal values ", 
        Maximize[{f, axisxfrom <= x <= axisxto}, x]}],
      Row[{"Minimal values: ", 
        Minimize[{f, axisxfrom <= x <= axisxto}, x]}], 
      Row[{"Function is convex ", Reduce[der2 > 0, x]}],
      Row[{"Function is concave ", Reduce[der2 < 0, x]}],
      Plot[f, {x, axisxfrom, axisxto}, 
       PlotRange -> {axisyfrom, axisyto}, Background -> LightGreen]
 {axisxfrom, -5}, {axisxto, 5}, {axisyfrom, -2}, {axisyto, 2}]
3 Replies

Are you exporting to FreeCDF or EnterpriseCDF? Only the latter supports InputField.

Posted 8 months ago

I have to send it to someone and I don't know what he has (FreeCDF or EnterpriseCDF). Is there some way to make it work even in Free CDF?

Would be nice to mention that you already asked that question and that you received the answer explaining that if your teacher uses FreePlayer then you can only use numeric input fields and workaround the limitation with predefined set of functions.

The only way to make non numeric InputFields work in .cdf is to have an enterprise Mathematica license which allows enterprise deploymen. This most likely isn't the case here.

Or to tell the teacher to open the .cdf from Mathematica rather than a FreePlayer.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract