Mathematica Calculate r^2*q Faster in Just 1 Click: Tips and Techniques

  • Thread starter Thread starter shafieza_garl
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
The discussion centers on efficiently calculating a mathematical expression involving variables r, s, and q without manually inputting each value of r. The user seeks a method to generate results for r values incrementing from 1 to 5 while keeping s and q constant. A solution is provided using a function definition in a programming context, specifically defining f[r, s, q] as r * s^2 * q. The user can then create a table of results for s=1 and q=3 by using a Table function, which generates all desired outputs in one command. This approach significantly streamlines the calculation process.
shafieza_garl
Messages
20
Reaction score
0
hye everyone...i would like to ask question. i just wonder how to calculate question faster without solving one by one.for my equation given.i want to know
if r increase by=1,2,3,4,5 and value of s are not change,how can i do without fill r by 1,2,3,4,5 one bye one.(q is fixed value).example
if s=1,q=3
and r is variable 1,2,3,4,5
so it become;
1(1^2)(3)=?
2(1^2)(3)=?
3(1^2)(3)=?
:
:
r(1^2)(3)=?
i want the output of all the answer in just 1 click.
i hope anyone can help me.
 

Attachments

  • test3.jpg
    test3.jpg
    1.4 KB · Views: 439
Physics news on Phys.org
I'm pretty sure that I don't understand what you want.
Do you want to generate a table of elements of the form r * s^2 * q ?

If so, then define
f[r_, s_, q_] := r * s^2 * q
and the table with s=1,q=3 is generated by
Table[f[r,1,3], {r, 1, 10}]
 
Thanx u very much.u answer helped me a lot.^^
 

Similar threads

Replies
2
Views
2K
Replies
9
Views
3K
Replies
5
Views
3K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
2
Views
2K
Replies
2
Views
3K
Replies
4
Views
2K
Back
Top