Why won't my plot work? (not elementwise issue)
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Axis Labels 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
