matlab中用for循环生成的n个单个数据怎么放入一个矩阵里

2025-02-23 18:47:55
推荐回答(1个)
回答1:

clc
clear
for i=1:40
if mod(i,2)==0
y(i)=0;
else
y(i)=1
end
end
Y=reshape(y,4,10)