printf error Wrong Argument 2

Tony Radice tradice at ieee.org
Tue Dec 6 01:20:21 CET 2011


Ladies and Gentlemen - 
    I apologize for this (possibly simple) question from a newbie - but
after looking for the problem on the wiki, on google, in the help files and
with a co worker we are stumped. The following code (sans the comments) is
the issue - we have tried it on 5.2.2 and 5.3.3 and the behaviour is the
same, so it's probably me. The question is "Why am I getting the error
identified, what does it mean, and would someone please point me in the
correct direction to clear it?"  I have tried changing the format
designators (f, g, and e), the resolution (6.3 is what i really want) and
moving the computations in and out of the printf statement. 

Code:
============================================
Vin_min = 12.0;    // Volts
Vin_max = 52.0;    // Volts
Vout_nom = 5.0;    // Volts

clc();
printf('Texas Instrument TPS40200 Design Computations\n\n');

// Program the Operating Frequency
Rrc = 68.1e03;    // Ohms
Crc = 470e-12;    // Farads

fsw = 1/(Rrc*Crc*0.105);
ircmax=((Vin_max/Rrc)*1.0e06);    // in uA
ircmin=((Vin_min/Rrc)*1.0e06);

// disp(ircmax)

// Check for internal switch / timing capacitor overload

if (Vin_max/Rrc)<=750e-6 then 
       {printf('Rrc OK\n\n')
       }
  else {
    printf('Rrc too small - correction required.\n')
    printf('Maximum current: %6.3f uA\n',ircmax)
//    printf('Minimum current: %6.3f uA\n', ircmin)
       }
end

printf('Operating Frequency: %6.3f KHz\n',(fsw/1000))

=======================================================
Error: (Console output)

 Texas Instrument TPS40200 Design Computations

Rrc too small - correction required.
Maximum current: 763.583 uA
    printf('Maximum current: %6.3f uA\n',ircmax)
                                                 !--error 44 
Wrong argument 2.

at line      43 of exec file called by :    
Internet Files\Content.IE5\NV866Z3M\TPS40200.sce', -1

=======================================================

Please note that the "Operating Frequency" statement works properly...

Again, Thank You for your patience with this novice...

Tony

--
View this message in context: http://mailinglists.scilab.org/printf-error-Wrong-Argument-2-tp3563077p3563077.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list