필터 지우기
필터 지우기

How to plot the dervative of a curve

조회 수: 3 (최근 30일)
ayat
ayat 2013년 2월 15일
Hi, I am very new to Matlab so apologies in advance! I have two columns of numbers which I have used for plotting a simple x-y curve. Now I need to have the derivate of this curve. So it would be like dx/dy for Y axis.
  댓글 수: 1
Jan
Jan 2013년 2월 15일
When you post the code (or an example code) for "I have two columns of numbers", it would be much easier to create an answer. Obviously Azzi fails to guess the names of the variables you use, and you fail to transfer his suggestion to you real application.

댓글을 달려면 로그인하십시오.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 2월 15일
For example
X=0:0.1:10 % Your x-axis
Y=sin(X) % Your strain signal
dY=diff(Y)./diff(X)
plot(X,Y) % Your original signal
hold on
plot(X(2:end),dY,'r') %Your derivative signal
  댓글 수: 19
Image Analyst
Image Analyst 2013년 2월 15일
편집: Image Analyst 2013년 2월 15일
Let's quit wasting time. ayat, upload your data somewhere - your favorite web site. Tell us the URL, and the code you used to read in the data file, so we can give you code that uses your exact data. Azzi's example was correct - you obviously changed something in it. You probably have a huge derivative because at some point(s) your curve turns almost vertical.
ayat
ayat 2013년 2월 16일
ok, here is the basic x-y I have:
So I need the change in the slope of this data plotted as a new curve. If you could give me the code that would do that I would really be grateful!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by