作者mp19990920 (郝渴连)
看板MATLAB
标题Re: [讨论] 产生arrays
时间Thu Mar 23 05:56:06 2017
写 matlab 请尽量不用回圈,
改用内建function来完成才会比较快,
而且好读、好debug。
N = 4;
a = mat2cell( (dec2bin(2^N-1:-1:0)=='1').' , ones(1, N), 2^N);
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 101.139.136.162
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1490219770.A.A34.html