How to do an equation for multiple variables and data?

3 Ansichten (letzte 30 Tage)
ETHAN FROHNA
ETHAN FROHNA am 15 Dez. 2020
Kommentiert: ETHAN FROHNA am 15 Dez. 2020
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

Akzeptierte Antwort

Alan Stevens
Alan Stevens am 15 Dez. 2020
Bearbeitet: Alan Stevens am 15 Dez. 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 ^

Weitere Antworten (0)

Kategorien

Mehr zu Numerical Integration and Differential Equations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by