I'm trying to understand how to use functions of the form:(adsbygoogle = window.adsbygoogle || []).push({});

fun = @(x) exp(-x.^2).*log(x).^2;

I see this syntax in various examples online, but when I try to use it I get the error:

"Attempt to execute SCRIPT integral as a function"

As a side note, it seems like every time I find an example of a script on the matlab website, I copy and paste it into matlab and it doesn't work. Am I going about learning this software the wrong way? The mathworks.com documentation center seems to frequently assume you already know something about the code, but it doesn't provide links to go back and read up on what you don't understand. It's a pretty frustrating website in my opinion. If anyone has advice on how to learn this software, please let me know what it is.

edit:

Found answer here:

https://www.physicsforums.com/showthread.php?p=4302248&posted=1#post4302248

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab functions

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**