How to plot energy v/s displacement graph if I have force v/s displacement graph with 25000 values?
Show older comments
I am using these lines to generate the value of Energy(E).
x=[1 2 3 4];
F=[ 12 45 78 45]; %i have 25000 such values
xx=x;
FF=F;
plot(x,F)
en=numel(x);
E=zeros(en);
for i=1:en
for j=en:i
xx(:, j) = [];
FF(:, j) = [];
end
E(i)=trapz(xx,FF);
end
E;
plot(x,E)
title('Energy v/s Displacement')
ylabel('Energy')
xlabel('Displacement')
First of all this is taking a lot of time and I have to press 'ctrl+C' almost all the time. There is some error in program at line E=zeros(en) I dont know how is E getting converted to double?
thanks for ur ans
1 Comment
abhilashdbire
on 18 Jun 2015
Answers (0)
Categories
Find more on Numerical Integration and Differentiation 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!