# Looping over two variables [closed]

Suppose I have $t=4, 2, 5$ and $v=5, 7, 4, 8, 0, 5$ and $equ=A v/t$. I would like to calculate $equ$ at a single value of $t$ by using all $v$ values and then move to next value of $t$.

How can I make a loop for this?

## closed as off-topic by Daniel Lichtblau, m_goldberg, eyorble, MarcoB, CoolwaterMay 4 '18 at 7:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, m_goldberg, eyorble, MarcoB, Coolwater
If this question can be reworded to fit the rules in the help center, please edit the question.

• tab = Table[A v/t, {t, {4, 2, 5}}, {v, {5, 7, 4, 8, 0, 5}}]. – Henrik Schumacher May 3 '18 at 15:28

Another simple way using Map:

 t = {4, 2, 5}; v = {5, 7, 4, 8, 0, 5};
equ = A (v/#) & /@ t

(*{{(5 A)/4, (7 A)/4, A, 2 A, 0, (5 A)/4}, {(5 A)/2, (7 A)/2,
2 A, 4 A, 0, (5 A)/2}, {A, (7 A)/5, (4 A)/5, (8 A)/5, 0, A}}*)

t = {4, 2, 5} ; v = {5, 7, 4, 8, 0, 5};
A Outer[#2/# &, t, v] (* or *)
A Outer[Divide, v, t] // Transpose


{{(5 A)/4, (7 A)/4, A, 2 A, 0, (5 A)/4}, {(5 A)/2, (7 A)/2, 2 A, 4 A, 0, (5 A)/2}, {A, (7 A)/5, (4 A)/5, (8 A)/5, 0, A}}

• thank you guys i appreciate your help – Rabia May 4 '18 at 9:39
• @rabia, my pleasure. Welcome to mma.se. – kglr May 4 '18 at 9:54