change of variable

1 visualización (últimos 30 días)
Baba
Baba el 3 de Nov. de 2011
I asked this question before but I missed an important point:
I would like to be able to Change 'X7' . I don't want to Do anything with the "X" because I have Y7, Z7,K7 in other plots. Basically I just want to be able to change the digit "7" and not the letters.
Here is my code:
subplot(3,2,1)
Hs=spectrum.periodogram;
psdest = psd(Hs,X7,'Fs',Fs);
semilogx(psdest.Frequencies,10*log10(psdest.Data));
grid on;
xlabel('Frequency (Hz)')
ylabel('dB/Hz')
title('X7')
  3 comentarios
Fangjun Jiang
Fangjun Jiang el 3 de Nov. de 2011
If you read the answers to your previous same question, both answers provide valid solution.
Walter Roberson
Walter Roberson el 3 de Nov. de 2011
The previous answers were at http://www.mathworks.com/matlabcentral/answers/20170-change-variable-name

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 3 de Nov. de 2011
Perhaps the answer being looked for here is a variation of Fangjun's earlier answer.
N = 7;
Str = sprintf('X%d', N);
psdest = psd(Hs,eval(Str),'Fs',Fs);
title(Str);
  1 comentario
Baba
Baba el 3 de Nov. de 2011
Yes, thanks for this

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by