想请教各位大大
我有一个变量A里面可能有三个变异量
在A变异量里面又各有两个变量B
如此总共会有2*2*2=2^3=8组
写法如下
GroupA_numPort=[ 1 2 3 ];
GroupB_CapVariable=[ 10e-6 100e-6 ];
iTest=0;
for i= 1:length(GroupB_CapVariable)
for j= 1:length(GroupB_CapVariable)
for k= 1:length(GroupB_CapVariable)
A_Port=[ GroupB_CapVariable(i) , GroupB_CapVariable(j) , GroupB_CapVaria
ble(k) ] ;
iTest=iTest+1;
end
end
end
因变量A有三个,必须写三次for loop
若变量A变成5、10、99......
不太可能写这么多个for loop@@
请问有什么方式可以实现N个for 循环吗?
谢谢大家指教!