MATLAB Answers

Siddhartha

How to find all possible combinations of 3 nos chosen from 3 different sets??

Asked by Siddhartha
on 1 May 2013

How to find all possible combinations of 3 numbers taking 1 from each set defined below C=1:1:100 D=1:1:150 E=1:1:125 Which means I want to make matrix of the order [(100C1 * 150C1*125C1)cross3] with all possible combinations

nchoosek(N,K) is not workin for multiple sets of nos..

  0 Comments

Products

No products are associated with this question.

1 Answer

Answer by Iman Ansari
on 1 May 2013

Hi.

C=1:1:100;
D=1:1:150;
E=1:1:125;
[x,y,z]=meshgrid(C,D,E);
A=[y(:) x(:) z(:)];

  0 Comments


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today