Azzera filtri
Azzera filtri

how to change title automatic ?

5 visualizzazioni (ultimi 30 giorni)
tomer polsky
tomer polsky il 30 Lug 2018
Commentato: tomer polsky il 30 Lug 2018
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 Commento
Jan
Jan il 30 Lug 2018
Most of the code does not concern the question. If you post the relevant part only, it would be less confusing.

Accedi per commentare.

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by