删除一条线从一个结构体
70(30天)
显示旧的评论
答案(2)
图像分析
2017年12月9日
从结构使用rmfield删除字段()。例如,如果结构叫做mystruct和field1字段,field2, field3, field4
mystruct。field1 = rand ();
mystruct。field2 = rand ();
mystruct。field3 = rand ();
mystruct。field4 = rand ();
你想要删除的字段名为“field4”你可以做
mystruct = rmfield (mystruct,“field4”);
结构没有行,
除非你的意思是,一个规范的线(像一个矢量点,或一个斜率和截距)存储在一个字段中。
0评论
MeLearningProgramming
2020年1月9日
结构可以有台词:如果你有
mystruct (1)。field1 = rand ();
mystruct (1)。field2 = rand ();
mystruct (1)。field3 = rand ();
mystruct (1)。field4 = rand ();
…直到
mystruct (9)。field1 = rand ();
mystruct (9)。field2 = rand ();
mystruct (9)。field3 = rand ();
mystruct (9)。field4 = rand ();
您可以删除一行是这样的:
mystruct (4) = [];