matlab 冒号使用 t=tt(191:end,:) 和ys=y(191:end,1)分别表示什么意思?matlab 冒号使用t=tt(191:end,:)和ys=y(191:end,1)分别表示什么意思?急求!谢谢

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 03:49:25
matlab 冒号使用 t=tt(191:end,:) 和ys=y(191:end,1)分别表示什么意思?matlab 冒号使用t=tt(191:end,:)和ys=y(191:end,1)分别表示什么意思?急求!谢谢

matlab 冒号使用 t=tt(191:end,:) 和ys=y(191:end,1)分别表示什么意思?matlab 冒号使用t=tt(191:end,:)和ys=y(191:end,1)分别表示什么意思?急求!谢谢
matlab 冒号使用 t=tt(191:end,:) 和ys=y(191:end,1)分别表示什么意思?
matlab 冒号使用
t=tt(191:end,:)
和ys=y(191:end,1)分别表示什么意思?
急求!谢谢

matlab 冒号使用 t=tt(191:end,:) 和ys=y(191:end,1)分别表示什么意思?matlab 冒号使用t=tt(191:end,:)和ys=y(191:end,1)分别表示什么意思?急求!谢谢
t=tt(191:end,:)
这句表示取矩阵tt的第191行到最后一行并且是所有列的元素赋值给t
ys=y(191:end,1)
这个取值时也是从191行开始到最后一行,但是只取第一列;
冒号前后分别就是行(列)号的开始和结束位置,如果要取行(列)的所有元素那就只用打一个冒号,可以不用打前后的行列号数字
你执行下面的代码看看
tt=[
1,2,3,4,5;...
1,2,3,4,5;...
1,2,3,4,5;...
1,2,3,4,5;...
1,2,3,4,5;...
]
t1=tt(3:end,:)
t2=tt(3:end,1)
t3=tt(1:3,1:3)