how can i call up either part of the results like (e1,e5,e6,e9)or (from e1 to e7)? then i need to combin them in one array
9 ビュー (過去 30 日間)
古いコメントを表示
if i have a lot of arrays with different dimensions and their names take the following forms :e1,e2,e3,...,e10 and so on. how can i call up either part of the results like (e1,e5,e6,e9)or (from e1 to e7)? then i need to combine them in one array . for your information , these array names resulted from this code :
a=[1:10];
c=length(a)
for k=1:10;
if (k<c)
b{k}=nchoosek(a,k)
end
end
0 件のコメント
回答 (1 件)
Roberto
2014 年 6 月 21 日
I'm assuming that the results e1, e2, e3... in the code you wrote is b{k}... you might get your results as an numeric array or as a cell array
Array form: Results 1 to 4
myArray = [b{1:4}]
Cell form: Results 7 to 2
myCell = b{7:-1:2}
Array form: Results 4 to last
myArray = [b{4:end}]
Cell form: Results 3, 6 and 2
myCell = b{[3,6,2]}
Array form: Every other result
myArray = [b{1:2:end}]
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Argument Definitions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!