When I run my code, I keep getting this error: Unable to convert expression into double array."
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
clear all
close all
syms z w
Gz=z/(z-1);
Gjw=subs(Gz,z,exp(j*w));
figure(1)
subplot(2,1,1)
stem(real(Gjw))
xlabel('frec (Hz)')
ylabel('MÓDULO')
stem(imag(Gjw)) %grafica la parte imag
subplot(2,1,2)
xlabel('frec (Hz)')
ylabel('ARGUMENTO')
sgtitle('G(jw)')
0 Commenti
Risposte (1)
Benjamin Thompson
il 14 Feb 2022
You should use i for the imaginary number, instead of j. In your subs command you have not defined what w is.
>> Gjw
Gjw =
exp(w*1i)/(exp(w*1i) - 1)
>> Gjw=subs(Gz,z,exp(i*w));
>> Gjw=subs(w, 2);
>> stem(real(Gjw))
Now there should be no error
0 Commenti
Vedere anche
Categorie
Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!