I have written a code to plot two variables x and y (which are defined in the code),though there isn't any error in execution but there is nothing in the figure i.e.the plot is blank,Can anyone help me to find whats wrong here?
Show older comments
function energy
figure (1); hold on;
E=1.44e9;
a=400e-6;
h=20e-6;
b=40e-6;
l=17.6e-6;
I=(1/12)*b*h.^3;
G=1.05e9;
A=b*h;
n=E*I/b;
t=(G*A/(E*I))^(1/2);
J=((n/(t*a^4))-(n/(G*A*a^4)));
F=50e-6;
x=(F*a.^2)/(E*I);
y=0.00001*n*(- 203.15*a.^4 + 463.68*a.^3 + 1912.38*a.^2 - 3466.66*a + 1290.87)*l.^2 + 0.00001*n*(33.81*a.^6 -
115.92*a.^5 - 604.35*a.^4 + 1958.6*a.^3 + 2364.9*a.^2 - 7835.38*a + 41984.0) - x.^2*J*cos(0.0046*a.^4 + 0.0105*a.^3 + 0.0956*a.^2 + 0.2049*a + 0.0001)*(sin(0.0046*a.^4 + 0.0105*a.^3 + 0.0956*a.^2 + 0.2049*a + 0.0001) - sin(0.00001))*(0.0184*a.^3 + 0.0315*a.^2 + 0.1912*a + 0.2049);
axis('auto');
plot(x,y)
3 Comments
Stalin Samuel
on 16 Nov 2015
plot(x,y,'*','MarkerSize',15)
Richardson Joseph
on 16 Nov 2015
Walter Roberson
on 16 Nov 2015
Notice that you are only plotting a single (x,y) pair, because your code does not involve vectors or arrays.
Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!