summaryrefslogtreecommitdiff
path: root/frdplot.sci
blob: f091e54b10ee8d55a4ce9309363b62a18b126612 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function frdplot(varargin)

// Plot the frequency domain response
// 
// Calling Sequence
// frdplot(plantData)
// Parameters
// frdData : frd type module
// 
// Description
// plantData must be frd type. Function takes the frequency and response data, and plot the bode plot.  
// Examples
// frdData = (1:100)';
// respData = rand(100,1) + %i * rand(100,1);
// plantData = frd(frdData,respData);
// frdplot(plantData)
// Authors
// Ashutosh Kumar Bhargava, Bhushan Manjarekar


    [lhs rhs] = argn(0)
    if rhs <> 1 then
        error(msprintf(gettext("%s: Wrong number of input arguments."),"frdplot"))
    end
    frdData  =  varargin(1)
    if typeof(frdData) <> 'frd' then
        error(msprintf(gettext("%s:Wrong type for input argument %d: ""frd"" expected."),"frdplot",1))
    end
    bode((frdData.Frequency)',(frdData.ResponseData)')
endfunction