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 comentarios

TAB
TAB el 24 de Oct. de 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 el 24 de Oct. de 2011
HI I have pasted the modified code...
Walter Roberson
Walter Roberson el 24 de Oct. de 2011
Pankaj, you have not indicated what the question or concern is?

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 24 de Oct. de 2011

0 votos

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 comentario

Walter Roberson
Walter Roberson el 24 de Oct. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Oct. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by