What does this code give o/p as?
1 次查看(过去 30 天)
显示 更早的评论
keyg=zeros(8,8);
key=[0 0 1 0 ;0 0 1 1 ;0 1 0 1; 0 1 1 1; 1 0 0 0; 1 0 1 0; 1 1 0 1; 1 0 1 1];
key1=[0 0 1 0 0 0 1 0 ;0 0 1 1 0 0 1 1 ;0 1 0 1 0 1 0 1; 0 1 1 1 0 1 1 1];
keyg(1:8,5:8)=key;
keyg(5:8,1:8)=key1;
orig_key=keyg;
2 个评论
Geoff Hayes
2021-5-14
Shruthi - you may need to provide some context. What are you hoping that this code will do?
采纳的回答
DGM
2021-5-14
编辑:DGM
2021-5-14
If you're asking what the output is (maybe you're away from a computer with Matlab at the moment)
keyg=zeros(8,8);
key=[0 0 1 0 ;0 0 1 1 ;0 1 0 1; 0 1 1 1; 1 0 0 0; 1 0 1 0; 1 1 0 1; 1 0 1 1];
key1=[0 0 1 0 0 0 1 0 ;0 0 1 1 0 0 1 1 ;0 1 0 1 0 1 0 1; 0 1 1 1 0 1 1 1];
keyg(1:8,5:8)=key;
keyg(5:8,1:8)=key1;
orig_key=keyg
I ran this using the tools in the editor used to make this post. I didn' have to even use Matlab. There is also a web-accessible version of Matlab available.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!