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!