How to do an equation for multiple variables and data?

I am tring to find the j polar momoment of inertia for mutliple hollow shafts:
or4=19.2
ir4=11.8
or5=18.8
ir5=12.2
or6=19.3
ir6=11.3
j4=(pi/2)*((or4)^4-(ir4)^4)
j5=(pi/2)*((or5)^4-(ir5)^4)
j6=(pi/2)*((or6)^4-(ir6)^4)
Is there a way I can perform these equations without having to repeatedly re-write the equations

 Respuesta aceptada

Alan Stevens
Alan Stevens el 15 de Dic. de 2020
Editada: Alan Stevens el 15 de Dic. de 2020
Like so
>> or = [19.2, 18.8, 19.3];
>> ir = [11.8, 12.2, 11.3];
>> j = (pi/2)*(or.^4 - ir.^4);
Notice .^ (ie dot^) not just ^

Más respuestas (0)

Categorías

Más información sobre Numerical Integration and Differential Equations en Centro de ayuda y File Exchange.

Preguntada:

el 15 de Dic. de 2020

Comentada:

el 15 de Dic. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by