Message Boards Message Boards

0
|
2507 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

MachinePrecision in LogPlot

Posted 10 years ago

I am encountering an error every time I call LogPlot for a compiled function:

 sw = Compile[{{s, _Real}}, s^2];
    LogPlot[sw[x], {x, 0, 1}]


CompiledFunction::cfsa: Argument x at position 1 should be a machine-size real number. >>

I don't understand what's the problem with LogPlot, everything works fine with Plot.

POSTED BY: Al Guy

Interesting. I can replicate that. This one works:

sw = Compile[{s}, s^2.];
ListLogPlot[Table[sw[x], {x, 0., 1., 0.01}], Joined -> True]

Cheers, Marco

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract