The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa.
For example,
>> project.name = MyProject
>> project.id = 1234
>> project.param.a = 3.1415
>> project.param.b = 42
becomes with str=xml_format(project, off )
"<project>
<name>MyProject</name>
<id>1234</id>
<param>
<a>3.1415</a>
<b>42</b>
</param>
</project>"
On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
漢諾塔!!!
Simulate the movement of the Towers of Hanoi puzzle Bonus is possible for using animation
eg. if n = 2 A→B A→C B→C
if n = 3 A→C A→B C→B A→C B→A B→C A→C
基于事件驅(qū)動的串口通訊控件
消息幀數(shù)據(jù)格式:
1 0 A B X X
其中 10 為消息標(biāo)識,
AB表示文本長度,L=A*100+B
XX為配位字符,任意
控制幀數(shù)據(jù)格式
0 1 A B M N
其中 01為控制標(biāo)識,
AB為請求標(biāo)識
MN為附加標(biāo)識
11表示請求對方接收文件,M表示描述字串中文件名子串的長度
N表示描述字串中文件大小子串的長度
10通知對方放棄傳輸
00通知文件傳輸完畢
01請求對方發(fā)送數(shù)據(jù), MN為10請求發(fā)送下一個
MN為00請求重發(fā)
數(shù)據(jù)幀數(shù)據(jù)格式
0 0 A B M N
其中 00 為數(shù)據(jù)標(biāo)識,
AB表示數(shù)據(jù)長度,L=A*100+B
MN為校驗,M*100+N=A+B