MATLAB GUI User Input Update -
i have matlab gui takes values user input , calculation based on , plot them in gui.
everything right , working when change values in gui not plot expected , gives , error of dimension mismatch. however, there no dimension mismatch , if go script , press run again (the big green arrow) , click plot again, plots values expected.
i have initialized of values use can not see how can fix this. need update command of script each time press 'plot' button.
any appreciated, many thanks!..
code:
a = str2double(get(handles.edit14,'string')); b = str2double(get(handles.edit15,'string')); c = str2double(get(handles.edit16,'string')); d = str2double(get(handles.edit18,'string')); e = str2double(get(handles.edit19,'string')); f = str2double(get(handles.edit20,'string')); veff=[a:b:c] %user input speeds (a,b,c) (comes user) q = 0.5*1.225*(veff*1000/3600)^2; f1=q*s; m1=q*s*cref; fx1=(f1*coef(:,1)); fz1=(f1*coef(:,3)); mm1=(m1*coef(:,5)); w=[d*g:e*g:f*g]; %define mass range (d,e,f comes user) lw=1:1:length(w) xgequation2max1 = ((((-fb*(xa-xb))-(((fx1(12)))*(za-zr))-(((fz1(7))))*(xa-xr))-((max(mm1))))./w(lw)) + xa; cgpercent(lw,column) = (xgequation2max1 - cstart)/cref * 100; end column=column+1; end speed_matrix = [a:b:c]; mass_matrix = [d:e:f]; ns = size(speed_matrix); ns= ns(2); count5 = 1; ns=1:1:ns hold axes(handles.axes4) plot(cgpercent(:,ns),transpose(mass_matrix)/1000) count5 = count5 + 1; end
main problem variables 'd,e,f' because when change 'a,b,c' (i.e speed) there no problem.
Comments
Post a Comment