Thx for the reply and sorry for being late in replying back, i admit that i'm stupid enough that I actually didn't open up the mycgimagic.m file and have a look to it's content.

Anyway, I am now creating a new algorithm, which is to calculate the square of a number (power of 2) by modeling to the sample m.file given in mycgimagic.m, I somehow stuck halfway and I can't pass back my result entirely, only the header is showing back. here is the coding

function firstdeploy() input = (getenv('QUERY_STRING')); printHeader() x=str2double(input.size); sqre(x); printContent() printFooter() end function sqre = sqre(x) sqre = (x^2); end function printHeader() fprintf(1,'Content-type: text/html\n'); fprintf(1,'\n'); %Print the HTML response page to STDOUT. fprintf(1,'<HTML>'); fprintf(1,'<HEAD><TITLE>My Squaring</TITLE></HEAD>'); fprintf(1,'<BODY>'); end function printContent() fprintf(1,'<P>This is the square of your input:</P>'); fprintf(1, sqre(x)); end function printFooter() fprintf(1,'</BODY>'); fprintf(1,'</HTML>\n'); end

I hope that any guru and masters here can point out my mistakes, I'm still very new to programming, willing to learn more about it. Sorry for any inconvenience caused


In reply to Re^2: Linking Matlab to process data for Personal Web Server by jyws89
in thread Linking Matlab to process data for Personal Web Server by jyws89

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.