??? Error using ==> plot Vectors must be the same lengths.
古いコメントを表示
Hi,
I'm experiencing this error when handling a function of my axes
??? Error using ==> plot Vectors must be the same lengths.
Error in ==>
BrakeDiscAnalysis>Plot_pushbutton_Callback at 595 plot(forceAxes,x,y,'-r')
How can I rectify this error? Below's my script
function Plot_pushbutton_Callback(hObject, eventdata, handles)
global ForceAxes
Df = str2num(get(handles.FrontRo_text,'string'));
forceAxes = ForceAxes;
%axes(ForceAxes);
df = linspace(0,Df(1),80)
x = df/Df(1);
y = (1+x)/2;
hold on
plot(forceAxes,x,y,'-r')
Thanks
採用された回答
その他の回答 (2 件)
dpb
2012 年 11 月 30 日
0 投票
Apparently ForceHandle isn't a valid axis handle; hence plot() thinks the x,y data are the handle and the x vector.
Use ishandle to test if it is a valid graphics handle;
doc ishandle % and links for more details
--
2 件のコメント
Image Analyst
2012 年 11 月 30 日
Hey dpb, welcome to the Answers forum! I think you'll find a lot more activity here than the newsgroup, plus the ability to edit posts is a MAJOR benefit over the newsgroup. I'm sure you'll be adding a wealth of knowledge here like you did to the newsgroup.
dpb
2012 年 11 月 30 日
I don't know, IA, TMW is going to have to improve the UI significantly I think before I'm likely to do much here--just too clunky/overhead-intensive for old text-newsreader-patterned geezer. :(
I've made some suggestions for improvement to TMW and have had/have a sorta' intermittent offline conversation w/ some of the staff and have promised as part of that to at least try some. So, I'm trying but it certainly is trying (my patience, that is) :(
Why, if they wanted a portal of their own they didn't start w/ a newsgroup-like interface product and add the fluff around it instead of trying to reinvent the wheel around a database is beyond my ken.
It takes at least an order of magnitude longer time to do less than I did/do at cs-sm and I don't see probably a tenth of the threads here whereas I try to at least skim virtually all there simply because of the time/effort required to keep paging back/forth, back/forth, back/forth...
カテゴリ
ヘルプ センター および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!