Use a vector a range of input values for a function

I have a function: angle_of_twist = (32 * T * L) / (G * ((D)^4) * 3.14) and I need to do this:
T=1
L=1
G=26000000000
5)Now perform the same calculation for a range of diameters specified by vector D = [0.001:0.0001:0.02] and save the result in variable Phi.

 채택된 답변

Akira Agata
Akira Agata 2017년 11월 28일
I think the following is what you want to do. Just FYI, I would recommend replacing '3.14' by pi for more precise calculation.
T = 1;
L = 1;
G = 26000000000;
D = 0.001:0.0001:0.02;
Phi = (32 * T * L) ./ (G * (D.^4) * 3.14);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

질문:

2017년 11월 28일

답변:

2017년 11월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by