Getting Real & Imaginary Numbers From Nyquist(Sys)

18 views (last 30 days)
Hi,
The Nyquist command return the real and imaginary numbers of the frequency response of a transfer function SYS in a matrix [RE, IM]
[RE, IM] = Nyquist(SYS);
I had assumed that the [RE, IM] is a matrix of values and I'm trying to get print out the real and imaginary numbers. But according to the LENGTH and SIZE commands the length of the matrix is 1. I get the following value when trying to assess the number of elements, rows or columns in the matrix:
I don't understand what is happening here. Where are the real and imaginary numbers actually stored and how can I access them?

Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 27 Mar 2016
%----Example-----
h=tf(1,1:2)
%------------------
[re,im,freq]=nyquist(h)
re=squeeze(re)
im=squeeze(im)
plot(re,im)

Ced
Ced on 27 Mar 2016
Hi
The values in RE and IM are, as you correctly assume, the real and imaginary values (of the vector w, which would be the 3rd output). The Nyquist function is able to handle MIMO systems. For this reason, the actual values RE and IM are stored in the third dimension.
I.e. if you have a 1x1 system, your output will be a 1x1xNw "matrix", where Nw is the number of frequency points. If you have a 2x1 system, the output is a 2x1xNw matrix, etc.

Community Treasure Hunt

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

Start Hunting!