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?
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?
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}}
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}}*)
tab = Table[A v/t, {t, {4, 2, 5}}, {v, {5, 7, 4, 8, 0, 5}}]. – Henrik Schumacher May 03 '18 at 15:28