Struct contents reference from a non-struct array object.
显示 更早的评论
I want to create two matrices: x for the even values of H & y for the odd ones
H= magic(35)+ pascal (35);
oc=1; % odd column
or=1; % odd row
ec=1; %even col
er=1; %even row
for i=1:35
for j=1: 35
if mod(H(i.j),2)==1
x(er,ec)=H(i.j);
er=er+1;
ec=ec+1;
else
y(or,oc)=H(i.j);
or=or+1;
oc=oc+1;
end
j=j+1;
end
i=i+1;
end
so after trying my code, it gave me 'Struct contents reference from a non-struct array object.' ,Can anyone tell me where the problem is ?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!