help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to strip carriage return or linefeed from a string


From: Hugo Coolens
Subject: how to strip carriage return or linefeed from a string
Date: Tue, 4 Dec 2012 10:52:46 +0100

I'm looking for a way to put two strings one representing a current
and one representing a voltage next to each other in a file. The
following is a code fragment:

usbtmc_write(fd,"MEAS:CURR?");
resultcurr = char(usbtmc_read(fd,readbytes))
strrep(resultcurr,'\n','')
usbtmc_write(fd,"MEAS:VOLT?");
resultvolt = char(usbtmc_read(fd,readbytes))
fprintf(file_id, '%s' , [resultcurr resultvolt])

I now get the following output in my outputfile
0.0249128
0.252767

But I want:
0.0249128 0.252767

Can anyone here solve this?

thanks
Hugo


reply via email to

[Prev in Thread] Current Thread [Next in Thread]