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.

 Respuesta aceptada

Akira Agata
Akira Agata el 28 de Nov. de 2017
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);

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 28 de Nov. de 2017

Respondida:

el 28 de Nov. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by