필터 지우기
필터 지우기

how to change title automatic ?

조회 수: 5 (최근 30일)
tomer polsky
tomer polsky 2018년 7월 30일
댓글: tomer polsky 2018년 7월 30일
for exmaple I have this code :
ta = 0:1/4000:2/60; % analog time axis
f_sample=800;
xa1 = cos(2*pi*60*ta+pi/3);
xa2 = cos(2*pi*340*ta-pi/3);
xa3 = cos(2*pi*460*ta+pi/3);
tn = 0:1/f_sample:2/60; % discrete-time axis as n*Ts
xn1 = cos(2*pi*60*tn+pi/3);
xn2 = cos(2*pi*340*tn-pi/3);
xn3 = cos(2*pi*460*tn+pi/3);
subplot(3,1,1);
plot(ta,xa1)
hold on;;
stem(tn,xn1);
title('x1(t)- f_a_n_a_l_o_g=60 f_s_a_m_p_l_e=400');
legend('blue-countinous(analog) signal','orange-discrete signal');
xlabel('ferquincy-[Hz]');
ylabel('x_1(t),x_1[n]');
subplot(3,1,2);
plot(ta,xa2);
hold on;
stem(tn,xn2);
title('x2(t)- f_a_n_a_l_o_g=340 f_s_a_m_p_l_e=400');
legend('blue-countinous(analog) signal','orange-discrete signal');
xlabel('ferquincy-[Hz]');
ylabel('x_2(t),x_2[n]');
subplot(3,1,3);
plot(ta,xa3);
hold on;
stem(tn,xn3);
title('x3(t)- f_a_n_a_l_o_g=460 f_s_a_m_p_l_e=400');
xlabel('ferquincy-[Hz]');
legend('blue-countinous(analog) signal','orange-discrete signal');
ylabel('x_3(t),x_3[n]');
for example I want to change f_sample and that it will change in the title automatic without changing it manually every time . Is there a way ?
  댓글 수: 1
Jan
Jan 2018년 7월 30일
Most of the code does not concern the question. If you post the relevant part only, it would be less confusing.

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

채택된 답변

Jan
Jan 2018년 7월 30일
maybe you want:
title(sprintf('x1(t)- f_{analog}=60 f_{sample}=%d', fsample));
  댓글 수: 1
tomer polsky
tomer polsky 2018년 7월 30일
that is exactly what I meant !!! thank you very much

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

추가 답변 (0개)

카테고리

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