Percentage change in the Y axix for unit change in X axis
조회 수: 1 (최근 30일)
이전 댓글 표시
If I have a 2D plot, how can I calculate the percentage change in the Y axix for unit change in X axis?
댓글 수: 0
답변 (1개)
Jonas
2021년 7월 20일
if you have y data along x you can calculate diff(y)./diff(x) to get the derivate. to get the pointswise percentage value divide additionally by y(1:end-1). FInally mutiply by 100 to get percentage values
x=201:300; y=1:100;
plot(x(2:end),diff(y)./diff(x)./y(1:end-1)*100);
ylabel('change in %')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Fit Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!