octave - How to convert to String? -


below commands :

theta = zeros(2, 1);         printf(theta) 

give error : error: printf: format template must string

is there function convert theta string or print theta value ?

reading octave doc : http://www.network-theory.co.uk/docs/octave3/octave_140.html seem possible ?

if trying sprint stdout stream can use printf without converting string works string formatting function in language first argument string followed variables want format , insert string. simple case:

printf('%f', theta) 

if trying print console however, suggest rather using sprintf or display. matlab doesn't have printf command , advocate keeping octave code directly portable matlab when possible.


Comments