I am creating some simple physics simulations for a frame problem, in which I want to show change in angular velocity of one point of a body as an angle changes.
I have assigned 'theta' to be a simple array [0:90] in a script and want a formula (derived for the particular problem) to produce an array of angular velocities as theta changes, and then plot them. The code is only returning a single angular velocity (i.e. velocity at theta = 45 deg) instead of producing an array of angular velocities that can be plotted. Any help is appreciated. Script code is below:
%% Angular Vel of AB
clear
clc
omegaOA = 10.472;
theta = [0:90];
omegaAB = (omegaOA*.08*cosd(theta))/(sqrt(.01-(.08.*sind(theta)+.01).^2));
plot(theta, omegaAB,'r-.')
Matlab produces a blank plot and assigns a single value to omegaAB instead of an array. 'omegaAB = 7.6926' Why is that? Does this require a separate function to be made?

 Respuesta aceptada

David Goodmanson
David Goodmanson el 20 de Abr. de 2017
Editada: David Goodmanson el 20 de Abr. de 2017

0 votos

Hello Ian, you forgot to put a dot in front of the divide sign: ./ in order to create element-by-element division.

1 comentario

Ian Blankenship
Ian Blankenship el 21 de Abr. de 2017
Thank you, would have taken me a while to notice that!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Preguntada:

el 20 de Abr. de 2017

Comentada:

el 21 de Abr. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by