Please help with this equation

i have inserted the following equation into matlab, i want values of Z for each value of w from 0.001:1000. but i keep getting a single value only. i will insert my matlab code below, i have converted the names of some values into simple a,b,c,e to make it easy for me to insert the values into matlab. ill insert some pictures what my question.
my matlab code: >> a = 1; t = 1; w = 0.001:1000; b = 10; d = 0.25; c = cos((d*pi)/2); e = w*t; z = sqrt((a.^(2)*e.^(2*d)+2*c*b*a*e.^(d)+b.^2)/(1+2*c*e.^(d)+e.^(2*d)))
z =
2.5265
>>

 Respuesta aceptada

Star Strider
Star Strider el 9 de Nov. de 2017
You need to completely vectorise your equation, including the division:
z = sqrt((a.^(2)*e.^(2*d)+2*c*b*a*e.^(d)+b.^2)./(1+2*c*e.^(d)+e.^(2*d)));
↑ ← VECTORISE DIVISION
That should work.

1 comentario

My pleasure.
Since this is homework, type:
lookfor log10
in your Command Window. Click on the result.
You could do the same for ‘plot’ (so lookfor plot). You would then see the documentation on the plot (link) function.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programming en Centro de ayuda y File Exchange.

Preguntada:

el 9 de Nov. de 2017

Comentada:

el 9 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