Why won't my plot work? (not elementwise issue)
Afficher commentaires plus anciens
Displaying T and d show this isn't an issue with elementwise operations (which is all I can find searching through the questions). Other plots have worked, so I know its not a graphics card issue, but I'm new to Matlab and can't see what's different from this plot and ones that have worked in the past. This is driving me insane, any help would be greatly appreciated.
format compact
clear all
close all
lCable = 2;
lPole = 2;
m = 100;
g = 9.81;
w = m*g;
d = linspace(1,1.9,19);
top = w*lCable*lPole;
bottom = d.*sqrt((lPole^2)-(d.^2));
T = top./bottom;
% T = (w*lCable*lPole)./(d.*sqrt((lPole^2)-(d.^2)))
disp(T);
figure()
plot(d,T)
xlim([0 2])
ylim([0 4])
title("Tension of Cable by Distance")
xlabel("distance (Meters)")
ylabel("Tension (Newtons)")
grid on
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Axis Labels dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
