MATLAB 7.0.4 (R14) HTML Support

Hi
here is the exact code:-
username = getenv('USERNAME');
FID = fopen('Report.htm','wt');
fprintf(FID,['%s\n'],'<html>','<head>','<title>','Report', ...
'<title>','<table border = "0" width="100%" ><tr><td width="10%" align = left >
<<logo.bmp>>
', ...
'<p align = "CENTER"><b><font size = "5"><font style ="text-transform:uppercase">','Report_mod', ...
'</font><font size = "3"/><p align = "RIGHT"><b> Created By:',username,'<b><p align = "RIGHT">Generated On: ',datestr(now),...
'<HR><HR color = "blue"><HR size = "3" width = "45">');

3 Kommentare

TAB
TAB am 24 Okt. 2011
The syntax of code you have posteted here is not correct. Please post the correct code and format it make it readable.
See Markup help on this page.
pankaj sarwe
pankaj sarwe am 24 Okt. 2011
HI I have pasted the modified code...
Walter Roberson
Walter Roberson am 24 Okt. 2011
Pankaj, you have not indicated what the question or concern is?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 24 Okt. 2011

0 Stimmen

When I test, the only difficulty I have with the code (after I fclose(FID) ) is that on my Linux system, there is no environment variable name USERNAME so that part comes out blank. (In Linux, the corresponding environment variable is named USER )
Tabrez's point about how %% should be used to represent % is technically correct, but in this particular case fprintf() is understanding the intent anyhow.
The output I see is:
<html>
<head>
<title>
Report
<title>
<table border = "0" width="100%" ><tr><td width="10%" align = left >
<<logo.bmp>>
<p align = "CENTER"><b><font size = "5"><font style ="text-transform:uppercase">
Report_mod
</font><font size = "3"/><p align = "RIGHT"><b> Created By:
<b><p align = "RIGHT">Generated On:
24-Oct-2011 13:06:31
<HR><HR color = "blue"><HR size = "3" width = "45">

1 Kommentar

Walter Roberson
Walter Roberson am 24 Okt. 2011
On the other hand, the <head> should either be left out or else you should have </head> immediately afterwards. There should be a <body> section right after that. Titles and tables do not belong in a head section, they belong in <body>. The <body> should then be terminated at the bottom with </body> and there should be an </html> to end everything off.
But those are HTML issues, not MATLAB issues.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 24 Okt. 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by