How do i plot nyquist from experiment data values

From the code in this page https://www.mathworks.com/help/control/ref/nyquist.html
if true
% load iddata2 z2;
sys_p = tfest(z2,2);
w = linspace(-10*pi,10*pi,512);
[re, im, ~, sdre, sdim] = nyquist(sys_p,w);
re = squeeze(re);
im = squeeze(im);
sdre = squeeze(sdre);
sdim = squeeze(sdim);
plot(re,im,'b', re+3*sdre, im+3*sdim, 'k:', re-3*sdre, im-3*sdim, 'k:')
end
Can i ask where is the part i input my experimental data values or the meaning of codes ? Sorry as i'm kind of new to Matlab with little guidance. Any help is appreciated !

 채택된 답변

Star Strider
Star Strider 2017년 1월 30일
If you just want the plot, do a separate nyquist call without any outputs:
figure(1)
nyquist(sys_p,w)
That should produce the plot you want.

댓글 수: 6

Hi there ! Thanks for the help it does make the plot slightly less complicated for me.
May i ask for the inputting of my experimental data is there a place to store the values so that the matlab can load it to the codes ?
It seems as thought you have loaded your experimental data as ‘z2’ into your workspace from a ‘.mat’ file. That is the easiest way.
‘May i ask for the inputting of my experimental data is there a place to store the values so that the matlab can load it to the codes ?’
I do not understand. It seems you already did that successfully.
The confusing part is i didn't input any data and i believe that the values are the default in the system, as the codes are directly retrieved by the website as attached.
In this case, is there any possibility to save my data as a certain file name manually ?
I didn’t look through the nyquist documentation far enough to see that you’re using an example from it. The data are part of the System Identification Toolbox documentation.
How you read your data into your MATLAB workspace depends on how you now have them stored. There are several ways to import your data into your MATLAB workspace. See the documentation for the importdata, xlsread, textscan and related functions to understand how to do this.
Once you’ve imported your data into your MATLAB workspace, a very easy way to save it to read later is to use the save function to create a ‘.mat’ file with your data. (This creates a new file and doesn’t replace your existing data file.) You can then import it into your MATLAB workspace whenever you want to use it with the load function. See the documentation for those functions to understand how to use them.
Thank you ! I'll try it out !
My pleasure!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

2017년 1월 30일

댓글:

2017년 1월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by