<html><DIV><FONT color=#0000ff size=2 face=Verdana>Lester,</FONT></DIV>
<DIV><FONT color=#0000ff size=2></FONT> </DIV>
<DIV><FONT color=#0000ff size=2>If you do not have the plotlib toolbox installed, I recommend it. It will handle the semilogx command</FONT></DIV>
<DIV><FONT color=#0000ff size=2>without having to convert to the Scilab plot command. Not that the plot command is bad, just easier</FONT></DIV>
<DIV><FONT color=#0000ff size=2>to convert. Post if yo uhave problems getting plot lib working. I just did this myself. Plotlib can be found</FONT></DIV>
<DIV><FONT color=#0000ff size=2>on the Scilab contributions site.</FONT></DIV>
<DIV><FONT color=#0000ff size=2></FONT> </DIV>
<DIV><FONT color=#0000ff size=2>Dave</FONT></DIV>
<BLOCKQUOTE style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"><FONT size=2 face=Tahoma>-----Original Message-----<BR><B>From:</B> Lester Anderson [mailto:lester@arctica1.wanadoo.co.uk]<BR><B>Sent:</B> Wednesday, September 2, 2009 01:30 PM<BR><B>To:</B> users@lists.scilab.org<BR><B>Subject:</B> [scilab-Users] Matlab to Scilab conversion<BR><BR></FONT>
<STYLE></STYLE>
<TABLE id=201179 border=0 width="100%" bgColor=#ffffff height=400>
<TBODY>
<TR>
<TD vAlign=top width="100%">
<DIV><FONT size=2 face=Arial>Hello</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I am fairly new to using Scilab (and Matlab) but need to convert some existing files. I have attached an example which I can't get to work and the image of the correct plot from Matlab.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Original Matlab file:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>rho_m=3300; % in kg/m^3<BR>rho_infill=2700; % in kg/m^3<BR>E=1e11; % in kg/m/s^2<BR>v=0.25;<BR>g=9.81; % in m/s^2<BR>l1=1e3:2e3:50e3; % in m<BR>l2=75e3:25e3:1000e3; % in m<BR>l=[l1 l2]; % in m<BR>k=1./l; % in 1/m</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>for Te=0:10e3:100e3 % in m<BR> D=E*Te^3/(12*(1-v^2));<BR> phi=1./((D.*k.^4./((rho_m-rho_infill)*g))+1);<BR> semilogx(k,phi)<BR> hold on<BR> title('\Phi _e(k) for various T_e')<BR> xlabel('Wavenumber k')<BR> ylabel('\Phi _e(k)')<BR>end<BR>text(1.7e-6,0.5,'T_e=100km')<BR>text(3.6e-5,0.5,'T_e=10km')<BR>text(8e-5,0.95,'T_e=0km')</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Output from the conversion below:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>// Display mode<BR>mode(0);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>// Display warning for floating point exception<BR>ieee(1);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>rho_m = 3300;<BR>// in kg/m^3<BR>rho_infill = 2700;<BR>// in kg/m^3<BR>E = 100000000000;<BR>// in kg/m/s^2<BR>v = 0.25;<BR>g = 9.81;<BR>// in m/s^2<BR>l1 = 1000:2000:50000;<BR>// in m<BR>l2 = 75000:25000:1000000;<BR>// in m<BR>l = [l1,l2];<BR>// in m<BR>k = 1 ./l;<BR>// in 1/m</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>for Te = 0:10000:100000<BR> // in m<BR> D = (E*(Te^3))/(12*(1-v^2));<BR> phi = 1 ./((D .*(k .^4)) ./((rho_m-rho_infill)*g)+1);<BR> // !! L.14: Matlab function semilogx not yet converted, original calling sequence used.<BR> semilogx(k,phi)<BR> set(gca(),"auto_clear","off")<BR> title("\Phi _e(k) for various T_e")<BR> xlabel("Wavenumber k")<BR> ylabel("\Phi _e(k)")<BR>end;<BR>// !! L.20: Matlab function text not yet converted, original calling sequence used.<BR>text(0.0000017,0.5,"T_e=100km")<BR>// !! L.21: Matlab function text not yet converted, original calling sequence used.<BR>text(0.000036,0.5,"T_e=10km")<BR>// !! L.22: Matlab function text not yet converted, original calling sequence used.<BR>text(0.00008,0.95,"T_e=0km")</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Hopefully someone can see what is needed to get things working. Thanks in advance all.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Lester Anderson</FONT></DIV>
<BLOCKQUOTE></BLOCKQUOTE></TD></TR></TBODY>
<BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></html>