return type of fgetl(serial)
1 回表示 (過去 30 日間)
古いコメントを表示
hi, i wanted to know the return data type(string, char ,array?) of fgetl(serial), because i need to read port through fgetl(serial).
http://www.mathworks.com/help/techdoc/ref/serial.fgetl.html
0 件のコメント
回答 (2 件)
Jan
2011 年 2 月 24 日
What about trying it?
x = fgetl(serial);
disp(class(x));
Looking in "doc serial/fgetl" it looks like it is a CHAR.
2 件のコメント
Walter Roberson
2011 年 2 月 24 日
Possibly upon timeout or end-of-file it would return a different class of data such as the number -1 or an empty numeric array. You would need to test this case.
Jan
2011 年 2 月 24 日
I've read http://www.mathworks.com/help/techdoc/ref/serial.fgetl.html and find the description of the outputs too vague. "[tline,count,msg] = fgetl(obj)" is helpful to detect timeouts and errors, but what is "msg" in case of success exactly?
@Safiullah Khan: The documentation is not clear enough in this point. Please send an enhancement request to TMW.
Safiullah Khan
2011 年 3 月 2 日
2 件のコメント
Jan
2011 年 3 月 2 日
Command window -> Help -> Web Resources -> Support
or
Type in the command window: "support". Then look for the contact form.
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!