Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Shell equivalent of matlab fwrite function Post 302960325 by darwin_886 on Friday 13th of November 2015 02:50:33 PM
Old 11-13-2015
Sorry - one other question. Although I can send the codes to port, it is very slow. I'm not sure why. I tried changing the baud rate but that didn't make any difference.

Not sure if this is relevant, but with the matlab serial function, I have the 'OutputBufferSize' argument set to 65535. Is there some equivalent argument for stty?
 

10 More Discussions You Might Find Interesting

1. Linux

Equivalent function of [ kbhit() ] In TURBO C

ANy one knows equivalent function of which in Turbo C. I want to Execute Certain loop until any key is pressed. i.e while(!kbhit) { ---------- ---------- } This code work fine in DOS but NOt in LINUX i try to use but not getting the expected result ... (0 Replies)
Discussion started by: niravuchat
0 Replies

2. Programming

equivalent function for wherey( ) ??

what is the equivalent function for wherey( ) ?? That is to return the current column position? (2 Replies)
Discussion started by: rockgal
2 Replies

3. Shell Programming and Scripting

Bash equivalent of perl's pack function ?

Is there an equivalent of perl's pack function in bash ? Or in other words, how can I achieve the same thing in bash ? Much appreciated. (1 Reply)
Discussion started by: NewDeb
1 Replies

4. Shell Programming and Scripting

shell script equivalent for tcl function

Hello, I need experts help in converting the below tcl function to korn shell function equivalent. proc lsNetMaskToBits {mask} { set dw ; # Top N bits set set dw 0x ; # Make sure it's hexadecimal, else XOR fails. puts "lsNetMaskToBits dw $dw" set dw ; # Complement => low 32-N bits... (1 Reply)
Discussion started by: JackMelson
1 Replies

5. Programming

segmentation fault in fwrite function

Hi, my code is written in proC and it is in UNIX(AIX).I have written a small code for writing data into a binary file,but while writing my program is giving core dump. Here Is my code---- fpWriteFile = fopen(WriteFileName,"wb+"); CHAR *recvgen; recvgen = (char... (7 Replies)
Discussion started by: ajaysahoo
7 Replies

6. Programming

Equivalent function for matlab on scilab

Hello everyone, i need help with this , i need the equivalent matlab funtion tf(x,y) in scilab and what do u recommend best from those three for a linux user (i need it for Control theory): 1-matlab 2-Scilab 3-Octave thank you for your time (0 Replies)
Discussion started by: abu_malek
0 Replies

7. Shell Programming and Scripting

Output of matlab as a variable for shell script

I'm running a matlab code within a shell script. This is how I do it, matlab -nodesktop -nosplash -nojvm -r "my_program;quit" This works fine. My matlab code prints out a single number, say "ans = 10" for example. I want to assign this to a variable in the shell script. I tried doing this... (18 Replies)
Discussion started by: lost.identity
18 Replies

8. Programming

The fwrite function is not returning error, if the file was removed.

The fwrite function call is not returning error, when the file it writes to is removed, please advise on how to find if the file already opened and being written by a program is removed manually or by some other process. please see the code below, #include<stdio.h> #include<stdlib.h> ... (3 Replies)
Discussion started by: Kesavan
3 Replies

9. Shell Programming and Scripting

Java - Arrays.binarySearch function equivalent in awk

Hi all Does anyone know Java-Arrays.binarySearch function equivalent in awk I tried like this but it's not correct one,it just returns array index if and only when searched value available in array, for some reason if searched value not found then I want to return upper nearest neighbour index.... (1 Reply)
Discussion started by: Akshay Hegde
1 Replies

10. Shell Programming and Scripting

Equivalent to let command in POSIX shell

Hi all, I am learning POSIX shell programming, and the book I read, uses the let command for integer arithmetic. I have downloaded and use the shellcheck program on Linux. This programs says: In POSIX sh, 'let' is undefined. See the screenshot attached. What is the POSIX... (1 Reply)
Discussion started by: johnprogrammer
1 Replies
DIO_TCSETATTR(3)							 1							  DIO_TCSETATTR(3)

dio_tcsetattr - Sets terminal attributes and baud rate for a serial port

SYNOPSIS
bool dio_tcsetattr (resource $fd, array $options) DESCRIPTION
dio_tcsetattr(3) sets the terminal attributes and baud rate of the open $fd. PARAMETERS
o $fd - The file descriptor returned by dio_open(3). o $options - The currently available options are: o 'baud' - baud rate of the port - can be 38400,19200,9600,4800,2400,1800, 1200,600,300,200,150,134,110,75 or 50, default value is 9600. o 'bits' - data bits - can be 8,7,6 or 5. Default value is 8. o 'stop' - stop bits - can be 1 or 2. Default value is 1. o 'parity' - can be 0,1 or 2. Default value is 0. RETURN VALUES
No value is returned. EXAMPLES
Example #1 Setting the baud rate on a serial port <?php $fd = dio_open('/dev/ttyS0', O_RDWR | O_NOCTTY | O_NONBLOCK); dio_fcntl($fd, F_SETFL, O_SYNC); dio_tcsetattr($fd, array( 'baud' => 9600, 'bits' => 8, 'stop' => 1, 'parity' => 0 )); while (1) { $data = dio_read($fd, 256); if ($data) { echo $data; } } ?> NOTES
Note This function is not implemented on Windows platforms. PHP Documentation Group DIO_TCSETATTR(3)
All times are GMT -4. The time now is 09:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy