我正在MATLAB中編寫兩個小型心理聲學測試應用程序。第一個沒有問題,但第二個沒有問題,我只是不明白爲什麼。爲什麼這個軸對象在MATLAB中不能正確顯示?
下面是問題:軸對象被創建,但它是空的。
failed_axis http://dl.getdropbox.com/u/98854/help.png
下面是創建這個數字和斧頭代碼:
hFig = figure('dockcontrols','off','menubar','none', ...
'name','choose the better sounding file', ...
'numbertitle','off','position',[0,0,700,500], ...
'resize','off','toolbar','none','units','normalized', ...
'color',[.8,.8,.8]);
progress_idc = axes('position',[.1,.8,.8,.05],'box','on','parent',hFig,...
'xlim',[-.03,1.03],'xtickmode','manual','xtick',[], ...
'xticklabelmode','manual','xticklabel',[], ...
'ylim',[-1,1],'ytickmode','manual','ytick',[], ...
'yticklabelmode','manual','yticklabel',[], ...
'nextplot','add');
這裏是在這個地塊軸(該功能通過一個定時器定期調用)的代碼:
function replot(varargin) % this is a nested function
cla;
% plot start_indicator
plot([x_start,x_start],[-.7,.7],'k','linewidth',2);
fill([x_start,x_start-.02,x_start-.02],[0,-.7,.7],[0,0,0]);
% plot stop_indicator
plot([x_stop,x_stop],[-.7,.7],'k','linewidth',2);
fill([x_stop,x_stop+.02,x_stop+.02],[0,-.7,.7],[0,0,0]);
% plot play_position
plot([x_play,x_play],[-1,1],'r');
drawnow;
end
這是什麼樣子的,如果它的工作原理:
proper_axis http://dl.getdropbox.com/u/98854/help2.png
你知道這裏出了什麼問題嗎?
我想你還需要顯示在軸上繪製對象的代碼。我不認爲上面的代碼足以繼續爲你找出解決方案。 – gnovice 2009-11-11 15:30:13