GUI vectors dimensions problem
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
I have created a gui file. That will take the signal's length,frequency,magnitude and phase and evaluate a sine signal according to this info and plot it. Everything works perfectly except phase term. When i try to consider phase shift in my calculation, i got "vector dimensions must agree" error. I am not able to add shift on my signal. The code i used fot this is below. What am i doing wrong ? Please help me it's urgent. Thank you.
%Get inputs from GUI
fs=str2double(get(handles.Fs,'String'));
a=str2double(get(handles.A,'String'));
p=str2double(get(handles.phase,'String'));
t = eval(get(handles.time,'String'));
phi=degtorad(p);
%Calculation
y=a*sin(2*pi*t+phi); <---- Problem is here.
% Create time plot in proper axes
plot(handles.time_waveform,t,y);
댓글 수: 1
Geoff Hayes
2014년 12월 2일
Mustafa - please past the complete error message. Also, put a breakpoint in the code at the line
y=a*sin(2*pi*t+phi);
and run your GUI. When the debugger pauses at this line, type the following lines in the Command Window, and record the results
size(a)
size(t)
size(phi)
답변 (0개)
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!