From: Jason Lea on 29 Apr 2010 07:26 Please could someone have a look at the code and assure me im not being an idiot. I have heard that i may be missing a module on matlab but can't see how to check. f = [0.5 1 2 5 7 10 15 20 30 50 100]'; w = 2*pi*f; a = [-1 -1 -1 -1 -1 -0.9 -0.9 -0.45 0.3 0.1 0]'; b = [0 0 0.05 0.25 0.4 0.7 0.7 1 0.4 0.05 0]'; %%% enter correct values for a and b h = a + b*j; %%%% nyquist plot figure (1) plot (real (h),imag (h)) %%%% or just plot (h) hold on plot (real (h),imag (h),'x') hold off
From: Rune Allnor on 29 Apr 2010 07:30 On 29 apr, 13:26, "Jason Lea" <jason....(a)student.manchester.ac.uk> wrote: > Please could someone have a look at the code and assure me im not being an idiot. I have heard that i may be missing a module on matlab but can't see how to check. > > f = [0.5 1 2 5 7 10 15 20 30 50 100]'; > w = 2*pi*f; > a = [-1 -1 -1 -1 -1 -0.9 -0.9 -0.45 0.3 0.1 0]'; > b = [0 0 0.05 0.25 0.4 0.7 0.7 1 0.4 0.05 0]'; > %%% enter correct values for a and b > h = a + b*j; > %%%% nyquist plot > figure (1) > plot (real (h),imag (h)) %%%% or just plot (h) > hold on > plot (real (h),imag (h),'x') > hold off Works with no problems or hick-ups. R2006a. Rune
From: Steven Lord on 29 Apr 2010 09:38 "Jason Lea" <jason.lea(a)student.manchester.ac.uk> wrote in message news:hrbqcc$2i$1(a)fred.mathworks.com... > Please could someone have a look at the code and assure me im not being an > idiot. I have heard that i may be missing a module on matlab but can't see > how to check. > > f = [0.5 1 2 5 7 10 15 20 30 50 100]'; > w = 2*pi*f; > a = [-1 -1 -1 -1 -1 -0.9 -0.9 -0.45 0.3 0.1 0]'; > b = [0 0 0.05 0.25 0.4 0.7 0.7 1 0.4 0.05 0]'; > %%% enter correct values for a and b > h = a + b*j; > %%%% nyquist plot > figure (1) > plot (real (h),imag (h)) %%%% or just plot (h) > hold on > plot (real (h),imag (h),'x') > hold off The subject line of your post indicates that you receive an error when you try this, but you didn't include the error message in your post. That would be very useful information and would likely indicate to the gurus the exact problem. If that error indicates a particular line, indicate which line of your code corresponds to the line number given in the error message as well. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
|
Pages: 1 Prev: dynamically scaling transfer function coefficients Next: Seasonal ARIMA models |