이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Hi all, I am doing a project which involves plotting peaks values in a waveform and finding the surface area. I m done with plotting, can anyone give me the idea of how to find a surface area for any waveform.
채택된 답변
Paulo Silva
2011년 3월 10일
doc trapz
doc cumtrapz
댓글 수: 22
santosh
2011년 3월 10일
Thanks for ur help,
I have tried with different wave forms but i m getting the same result. Can u pls help me
You have the sampling frequency (Fs) of the wav, time values (X) and amplitude of the wav (Y), you just need to calculate:
trapz(X,Y)/Fs
santosh
2011년 3월 10일
thanks for ur prompt reply paulo,
I dont have sampling frequency for each wave, I just have time and amplitude. Is it possible to get without the frequency or if no, then pls help me out to find the sampling frequency for each wave I choose.
Fs=1/(t(ind+1)-t(ind))
santosh
2011년 3월 10일
thnx paulo
I used the above function but it is showing me the error as
??? Error using ==> mrdivide
Matrix dimensions must agree.
Error in ==> trialdiff45matrix at 216
Z = cumtrapz(t(record2),1)/Fs;
Here is the figure code which i m using to plot and i trying to find the surface area of that wave, I used the matrices to plot this wave may be this is causing me the error. Pls have a look on this code
figure(7);
plot(t,Z2,t(record2),Z2(record2),'r*');
title('Averaged desired points found through Absolute Difference matrix');
Fs=1/(t(record2+1)-t(record2))
Z = trapz(t(record2),Z2(record2))/Fs
insert a . before / so the operations can be done element by element, I'm not sure about what your are doing. Fs should be a single value not a vector but with luck it could work.
Just in case you got different Fs values in a time vector (t) and you want to know the values do this:
unique(1./diff(t))
santosh
2011년 3월 11일
pls have a look on ur mail paulo I sent u the code and input file as well
I'm very sorry but I just can't help everyone that sends me emails, everyday someone sends their homework to my email but I have my own important things to do and the time spent here is already too much, it's better for you to put your questions and doubts here for all to see!
santosh
2011년 3월 11일
hello,
sorry for the mail.
I have large number of input files which consists of data in CSV format. Each data file has about 600 rows and 2 columns. So i want to find the surface area under the curve for each file after plotting. can u plz help me out.
The way I told you to calculate Fs, does it return one value of Fs for a given file data?
santosh
2011년 3월 11일
No, actually it is returning more values.
are the values very similar, if so average them and use that value for Fs
santosh
2011년 3월 11일
I tried taking average and i got one value. but getting same value for different data files
that means that all measurements used the same Fs don't you agree?
santosh
2011년 3월 11일
No all the measurments have variations even the surface area calculation:
Fs=1/(t(record2+1)-t(record2));
Q= mean(Fs);
Z = trapz(t(record2),Z2(record2))/Q;
for above variables the values are same for different measurments.
what's record2?
santosh
2011년 3월 11일
record2 is an index which contains time and voltage values
Try with cumtrapz
Fs=1/(t(record2+1)-t(record2));
Q= mean(Fs);
Z = cumtrapz(t(record2),Z2(record2))/Q;
santosh
2011년 3월 11일
I m getting the following output as
Z =
1.0e-010 *
0
-0.0102
-0.3311
-0.3460
-0.3568
-0.3329
0.0241
0.0460
>> Fs
Fs =
1.0e+006 *
0 0 0 0 0 0 0 5.0000
the above result is same for all the data files.
there's something wrong with your code, please check it, it's too late here, must go sleep a bit, good luck finding the error, bye
santosh
2011년 3월 11일
thnx alot for ur answers i will work out and catch u tomorrow gud nt.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
