Multiplication of 2 sets to get all possible outcomes
1 view (last 30 days)
Show older comments
Assiya Syzdykova
on 22 Jan 2021
Answered: James Tursa
on 22 Jan 2021
Hello everyone!
I've been wondering how can I have all posible multiplication outcomes of 2 sets of numbers:
a = 0:0.01:0.2;
b = 0:pi/12:pi;
I want to know all 273 possible multiplications between a and b:
a*sin(b)
Does anyone have an idea how to make it?
0 Comments
Accepted Answer
David Hill
on 22 Jan 2021
Edited: David Hill
on 22 Jan 2021
a = 0:0.01:0.2;
b = 0:pi/12:pi;
[A,B]=meshgrid(a,sin(b));
C=A.*B;
c=unique(C(:)');%if you only want unique outcomes.
0 Comments
More Answers (1)
See Also
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!