From: Putrisia Hendra on
hi guys..
actually i just want to ask you about AVGPOWER in Matlab..
this function tell us about average power a signal.
so, if we want to use that function in GUI how we can do that? i mean what should we d first?
i have some code:

% compute the power spectrum, telling the FFT to use length(x) as the number of
%points in the FFT, and to use the sampling frequency 256Hz.
[P,f] = periodogram(x2,[],length(x2),256);
%the function returns a vector of frequencies at which the FFT was computed, f,
%and the power at each frequency, P.


temp_1((1:15386),1)=P;
temp_1((1:15386),2)=f;
delta=[temp_1((1:8),1) temp_1((1:8),2)];
theta=[temp_1((9:16),1) temp_1((9:16),2)];
alpha=[temp_1((17:24),1) temp_1((17:24),2)];
beta=[temp_1((25:40),1) temp_1((25:40),2)];
delta=sortrows(delta);
alpha=sortrows(alpha);
beta=sortrows(beta);
theta=sortrows(theta);

d=avgpower(delta)

set(handles.delta,'String',d)
guidata(hObject,handles)

avgpower is doent work here..

are there any solution bout my code?
From: Putrisia Hendra on
"Putrisia Hendra " <putrisiazahra(a)gmail.com> wrote in message <i3anpt$ocd$1(a)fred.mathworks.com>...
> hi guys..
> actually i just want to ask you about AVGPOWER in Matlab..
> this function tell us about average power a signal.
> so, if we want to use that function in GUI how we can do that? i mean what should we d first?
> i have some code:
>
> % compute the power spectrum, telling the FFT to use length(x) as the number of
> %points in the FFT, and to use the sampling frequency 256Hz.
> [P,f] = periodogram(x2,[],length(x2),256);
> %the function returns a vector of frequencies at which the FFT was computed, f,
> %and the power at each frequency, P.
>
>
> temp_1((1:15386),1)=P;
> temp_1((1:15386),2)=f;
> delta=[temp_1((1:8),1) temp_1((1:8),2)];
> theta=[temp_1((9:16),1) temp_1((9:16),2)];
> alpha=[temp_1((17:24),1) temp_1((17:24),2)];
> beta=[temp_1((25:40),1) temp_1((25:40),2)];
> delta=sortrows(delta);
> alpha=sortrows(alpha);
> beta=sortrows(beta);
> theta=sortrows(theta);
>
> d=avgpower(delta)
>
> set(handles.delta,'String',d)
> guidata(hObject,handles)
>
> avgpower is dosnt work here..
>
> are there any solution bout my code?




there are the error explanation

??? Error using ==> skripsi>hitung_Callback
Too many output arguments.

Error in ==> skripsi>delta_CreateFcn at 252
set (hitung_Callback,avgpower(delta));

Error in ==> gui_mainfcn at 96
feval(varargin{:});

Error in ==> skripsi at 42
gui_mainfcn(gui_State, varargin{:});

??? Error using ==> struct2handle
Error while evaluating uicontrol CreateFcn

??? Error using ==> skripsi>hitung_Callback
Too many output arguments.

Error in ==> skripsi>delta_CreateFcn at 252
set (hitung_Callback,avgpower(delta));

Error in ==> gui_mainfcn at 96
feval(varargin{:});

Error in ==> skripsi at 42
gui_mainfcn(gui_State, varargin{:});

??? Error using ==> struct2handle
Error while evaluating uicontrol CreateFcn



Help Me Plis...!
From: Steven_Lord on


"Putrisia Hendra " <putrisiazahra(a)gmail.com> wrote in message
news:i3aomn$l3o$1(a)fred.mathworks.com...
> "Putrisia Hendra " <putrisiazahra(a)gmail.com> wrote in message
> <i3anpt$ocd$1(a)fred.mathworks.com>...

*snip*

> there are the error explanation
>
> ??? Error using ==> skripsi>hitung_Callback
> Too many output arguments.
>
> Error in ==> skripsi>delta_CreateFcn at 252
> set (hitung_Callback,avgpower(delta));

There are several issues here.

First, this line of code does not appear in the code that you posted in your
original message. If you're looking for help with debugging a piece of
code, you should post the EXACT code that you're using, not "something
similar". Posting "something similar" to the code about which you're asking
for help rather than the ACTUAL code just tends to aggravate people.

Second, the most common way to call the SET function requires an odd number
of inputs; the first is the object or objects whose properties you are
trying to set, and the following pairs of inputs are parameter names and the
values you want to specify for those parameters. [There is another way to
call SET with an even number of inputs, but let's not get into that right
now.] So even if you fix the third problem that I'm going to discuss in a
second, this code would not work.

Third, this error message suggests that the avgpower function does not
return an output argument. If avgpower is a function you've written, you
need to debug it and determine why it doesn't return an output. If it's not
a function you've written, you should check to make sure you're calling it
correctly and if you are, contact the author of the function for help in
debugging it.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com