arrayfun(@(z) plus(z, k), x)
the script tag should look like <script type="text/javascript">
also it is preferable to use the dom to insert content into the page, not document.write.
in the head:later on in the body:PHP:<script type="text/javascript">onload = function(){
document.getElementById("lastModified").innerHTML = "Page last changed " + document.lastModified.split(" ")[0];
}</script>good read: http://www.quirksmode.org/js/lastmod.htmlHTML:<span id="lastModified"></span>