There is any function displacement
이전 댓글 표시
This array
I want find differential between the numbers then, i want find displacement
and thank u
답변 (1개)
Joseph Cheng
2015년 5월 17일
편집: Joseph Cheng
2015년 5월 17일
you can use the function diff() to perform this differential. so you'll have something like
da = diff(a); %this will get your your [4 5 ...]
then you can perform your da./a(1:end-1)*100.
댓글 수: 7
abduall hassn
2015년 5월 17일
편집: abduall hassn
2015년 5월 17일
Joseph Cheng
2015년 5월 17일
편집: Joseph Cheng
2015년 5월 17일
well then you did not explain it very well. this will give you the displacement that you asked for of each neighboring indexes, so by going diff(a) you get your first second third differential like you explained. Then you can divide by the original and multiply by the 100.
so if
da = 100*diff(a)./a(1:end-1)
is not what you are looking for please explain more
abduall hassn
2015년 5월 17일
abduall hassn
2015년 5월 17일
Image Analyst
2015년 5월 17일
Try executing this line of code before you do that:
format long g;
abduall hassn
2015년 5월 19일
Joseph Cheng
2015년 5월 19일
da = diff(a,[],2)./a read the documentation of the function diff() to see that by performing diff(a,[],2) we perform it in the correct dimension.
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!