strcat not converting cell into string...in Octave 4.2.2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
RT
Reply | Threaded
Open this post in threaded view
|

strcat not converting cell into string...in Octave 4.2.2

RT
Greetings
After a M file was completed I would have Octave 4.0 execute a simple audio command "espeak" to tell me when a crossfade was completed.

The line below worked in octave 4.0 on ubuntu 16.04 64bit
system (strcat({'espeak '},'"' ,'Done with cross fade','"'))

but when I upgraded to ubuntu 18.04 which has Octave 4.2.2
I get an error
error: wrong type argument 'cell'
error: system: first argument must be a string

I thought strcat was suppose to convert everything into a string?  any work arounds?

Thanks

--
--
|======================================================|


Reply | Threaded
Open this post in threaded view
|

Re: strcat not converting cell into string...in Octave 4.2.2

bpabbott
Administrator
On Apr 29, 2018, at 10:21 AM, RT <[hidden email]> wrote:

Greetings
After a M file was completed I would have Octave 4.0 execute a simple audio command "espeak" to tell me when a crossfade was completed.

The line below worked in octave 4.0 on ubuntu 16.04 64bit
system (strcat({'espeak '},'"' ,'Done with cross fade','"'))

but when I upgraded to ubuntu 18.04 which has Octave 4.2.2
I get an error
error: wrong type argument 'cell'
error: system: first argument must be a string

I thought strcat was suppose to convert everything into a string?  any work arounds?

Thanks

I expect a change was made for compatibility with Matlab.

-----------------
strcat({'espeak '},'"' ,'Done with cross fade','”')

ans = 

    'espeak "Done with cross fade"'

whos ans
  Name      Size            Bytes  Class    Attributes

  ans       1x1               170  cell
-----------------

A simple fix is to covert to a cs-list (this works for Octave, but not Matlab).

system (strcat({'espeak '},'"' ,'Done with cross fade','”’){:})

Ben