Advertisement
DanSt3fan

N212

May 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.29 KB | None | 0 0
  1. SCRIPT pc
  2. function C = pc(A,B)
  3. a=length(A);
  4. b=length(B);
  5. k=1;
  6. for i=1:a
  7.     for j=1:b
  8.         C{1,k}=[A(1,i) B(1,j)];
  9.         k=k+1;
  10.     end
  11. end
  12. end
  13.  
  14. N212
  15. A=input('Multimea A este: ');
  16. B=input('Multimea B este: ');
  17. C=pc(A,B);
  18. disp('Produsul cartezian este: ');
  19. celldisp(C);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement