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!
