필터 지우기
필터 지우기

Need to write a code for this method....

조회 수: 2 (최근 30일)
Ara
Ara 2013년 3월 6일
Hi Everyone,
I need to write a code for the following method.I want to compute 10log s(t1)/s(1)
t1=1,2,3...,N (second)while the data (both s and t)are in one minute.
s t
0.05 4.7
0.1 4.8
0.2 4.9
0.1 4.10
0.3 4.11
Could you please guide me?
Thanks,
  댓글 수: 2
ChristianW
ChristianW 2013년 3월 6일
  • What class are s and t? Char or Double?
  • s=0.05min means 0 min and 0.5 sec?
  • Does t allways do 1 sec steps?
Ara
Ara 2013년 3월 6일
No, S is column data which all represent as an integer value. If SI=10logs(t1)/s(1) I want to plot (t,SI)in second. s(t1)denote value s in the first minute. It means s computed in minutes and I want to compute SI while should be calculate in second.So the question is how can I write a code to compute SI. As I assume t1=4.7 is first minutes that S(1)=0.05 for first point then SI=10log(s/0.05)in dB. T just used for plot so I guess the value of s should change and convert to second, right?

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

채택된 답변

ChristianW
ChristianW 2013년 3월 6일
Since your explanations feel like a puzzle, whats wrong with this?
N = 60; % or N = length(t)
t1 = 1:N; %[sec] timesteps
s = rand(1,N+100); %[any unit] generate random data s
SI = 10*log10(s(t1)/s(1)); %[dB]
plot(t1,SI); xlabel('time [sec]'); ylabel('SI [dB]')
  댓글 수: 11
Ara
Ara 2013년 3월 7일
Exactly, s(2)==s4(2) and s(a)=s(1) because the figure supposed to show the signal that look like s4 so the point where s4 are not increase the SI should show the value of around 0 dB with slightly fluctuations and where s4 is increase the SI should show large fluctuations. Another question is, How to convert S4 to second first? and then calculate it by using that relation.
Ara
Ara 2013년 3월 11일
편집: Ara 2013년 3월 11일
Thanks, Christian. Your code works properly for the other types of my data. Sorry for the late response.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by