Prev: Simscape>Mechanical Source
Next: ezplot3 and hold bug?
From: roya olyazadeh on 29 May 2010 13:41 This is my matrix : X00 = Columns 1 through 3 1000 939.073645098372 814.549313652745 Columns 4 through 6 878.926 912.009169278451 893.126889224274 ??? Subscript indices must either be real positive integers or logicals. Error in ==> networkadjustment at 480 min(X00) What is the problem ? each element seems to be real positive integers.
From: Bruno Luong on 29 May 2010 13:51 "roya olyazadeh" <roya2543(a)gmail.com> wrote in message <htrjji$34i$1(a)fred.mathworks.com>... > > What is the problem ? each element seems to be real positive integers. Do not name your variable MIN Bruno
From: Matt Fig on 29 May 2010 13:55 You are the 1,345,657th person to name a variable after a built-in MATLAB function, then try to call the function.
From: Roger Stafford on 29 May 2010 13:56 "roya olyazadeh" <roya2543(a)gmail.com> wrote in message <htrjji$34i$1(a)fred.mathworks.com>... > This is my matrix : > > X00 = > > Columns 1 through 3 > > 1000 939.073645098372 814.549313652745 > > Columns 4 through 6 > > 878.926 912.009169278451 893.126889224274 > > > ??? Subscript indices must either be real positive integers or logicals. > > Error in ==> networkadjustment at 480 > min(X00) > > > What is the problem ? each element seems to be real positive integers. I would guess that somewhere you have an array named 'min' and matlab is objecting to the fact that the elements of X00, used as indices into 'min', are not positive integers, which in fact they are *not*. You should never give your variables the names of matlab functions, for precisely this reason. Roger Stafford
From: Matt Fig on 29 May 2010 14:06
Put this function in your current directory, then just before the line that errors in networkadjustment (line 480) call CHECKVARS. function [] = checkvars() %CHECKVARS Check the variables in current workspace for function masking. % CHECKVARS finds out if one of the variables in the current workspace is % masking another function or directory or javaclass. If any variables are % masking something on the searchpath, a warning will be issued in the % command window. If no conflicts are found, CHECKVARS returns nothing. % % % Author: Matt Fig who_out = evalin('caller','who'); % Get a list of variables in caller. for ind_var = 1:length(who_out) exist_out = exist(who_out{ind_var}); %#ok Find if other names match. switch exist_out case 2 conflict_type = ' M-File function.'; case 3 conflict_type = ' MEX function.'; case 4 conflict_type = ' mdl file.'; case 5 conflict_type = ' built-in function.'; case 6 conflict_type = ' P-File function.'; case 7 conflict_type = ' directory.'; case 8 conflict_type = ' Java class.'; otherwise exist_out = 0; end if exist_out fprintf(['''',who_out{ind_var},... ''' may be masking a',conflict_type,'\n']) end end |