Error Using Subsindex Matlab
Contents |
Support Answers MathWorks Search MathWorks.com MathWorks Answers Support MATLAB Answers™ MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors Recent Activity Flagged Content function 'subsindex' is not defined for values of class 'function_handle'. Flagged as Spam Help MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs function 'subsindex' is not defined for values of class 'cell'. legend Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as Spam Help Trial software
Function 'subsindex' Is Not Defined For Values Of Class 'network'.
carlos Uribe (view profile) 13 questions 1 answer 0 accepted answers Reputation: 3 Vote1 Problem with Subplot "Error using subsindex" Asked by carlos Uribe carlos Uribe (view profile) 13 questions 1 answer 0 accepted answers
Function 'subsindex' Is Not Defined For Values Of Class 'tf'.
Reputation: 3 on 1 Mar 2013 Latest activity Edited by Nishant Kumar Nishant Kumar (view profile) 1 question 0 answers 0 accepted answers Reputation: 0 on 14 Sep 2015 Accepted Answer by Walter Roberson Walter Roberson (view profile) 27 questions 27,551 answers 9,623 accepted answers Reputation: 49,797 170 views (last 30 days) 170 views (last 30 days) I'm writing a code to plot several subplots in a figure...to simplify it function subsindex is not defined for values of class matlab ui control uicontrol it looks something like this:h1=subplot(3,2,1); plot(x,y) set(h1,'XTickLabel',{'A','B'},'YTick',[1 2 3],'FontSize',12,'FontWeight','Bold') This works fine, I finish the different subplots in this figure...Then I open a second figure and try the same thing:figure; h2=subplot(3,2,1); plot(x2,y2); set(h2,'XTickLabel',{'C','D'},'YTick',[4 5 6],'FontSize',12,'FontWeight','Bold') In this case I get the error:Error using subsindex Function 'subsindex' is not defined for values of class 'cell'. What do I need to do to make it work? why does it work for the first figure (first subplot of first figure to be specific) but it gives me trouble when I try to do the same thing on the second one?Any help is appreciated...Thanks. 0 Comments Show all comments Tags subplotsfiguresxticklabel Products No products are associated with this question. Related Content 1 Answer Walter Roberson (view profile) 27 questions 27,551 answers 9,623 accepted answers Reputation: 49,797 Vote4 Link Direct link to this answer: https://www.mathworks.com/matlabcentral/answers/65423#answer_76957 Answer by Walter Roberson Walter Roberson (view profile) 27 questions 27,551 answers 9,623 accepted answers Reputation: 49,797 on 1 Mar 2013 Accepted answer You could get that error if somehow in-between those two, "set" had become a variable, so it thought everything in your () were indices into "set". 2 Comments Show all comments carlos Uribe carlos Uribe (view profile) 13 questions 1 answer 0 accepted answers R
Support Answers MathWorks Search MathWorks.com MathWorks Answers Support MATLAB Answers™ MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs
Function 'subsindex' Is Not Defined For Values Of Class 'datetime'
Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors cell to string matlab Recent Activity Flagged Content Flagged as Spam Help MATLAB Central Community Home MATLAB Answers File Exchange index exceeds matrix dimensions Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as Spam Help Trial software Jan (view profile) 7 questions https://www.mathworks.com/matlabcentral/answers/65423-problem-with-subplot-error-using-subsindex 1 answer 0 accepted answers Reputation: 0 Vote0 subsindex error Asked by Jan Jan (view profile) 7 questions 1 answer 0 accepted answers Reputation: 0 on 16 Apr 2012 Accepted Answer by Walter Roberson Walter Roberson (view profile) 27 questions 27,551 answers 9,623 accepted answers Reputation: 49,797 76 views (last 30 days) 76 views (last https://www.mathworks.com/matlabcentral/answers/35639-subsindex-error 30 days) In this piece of script I am trying to use a shortcut adapted from another script so that I don´t have to write out each file name I want to import. %open right path cd (PATHIN) %read in all -vhdr files list=dir('*.vhdr'); len=length(list); SUBJ=cell(1,len); Here I check what SUBJ is and get [] [] as the answer...So then I start the for loop to read in the data: for s=1:len(SUBJ)And it gives me an error which says- Error using subsindex. Function ´subsindex´ is not defined for values of class ´cell´.I am guessing that when I writelen=length(list); I am converting the list into a numerical value of the number of files so that are in the directory. What should I write instead?Thanks in advance for the help! JD 0 Comments Show all comments Tags subsindexcell Products No products are associated with this question. Related Content 1 Answer Walter Roberson (view profile) 27 questions 27,551 answers 9,623 accepted answers Reputation: 49,797 Vote1 Link
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this http://stackoverflow.com/questions/10061337/matlab-error-function-subsindex-is-not-defined-for-values-of-class-struct site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up matlab error: is not Function 'subsindex' is not defined for values of class 'struct' up vote 4 down vote favorite I tried these commands: im=imread('untitled_test1.jpg'); im1=rgb2gray(im); im1=medfilt2(im1,[15 15]); BW = edge(im1,'sobel'); msk=[0 0 0 0 0; 0 1 1 1 0; 0 1 1 1 0; 0 1 1 1 0; 0 0 0 0 0;]; B=conv2(double(BW),double(msk)); Ibw = im2bw(B); CC = bwconncomp(Ibw); %Ibw is my binary image is not defined stats = regionprops(CC,'pixellist'); % pass all over the stats for i=1:length(stats), size = length(stats(i).PixelList); % check only the relevant stats (the black ellipses) if size >150 && size < 600 % fill the black pixel by white x = round(mean(stats(i).PixelList(:,2))); y = round(mean(stats(i).PixelList(:,1))); Ibw = imfill(Ibw, [x, y]); else Ibw([CC.PixelIdxList{i}]) = false; end; end; (here I have another command lines, but I guess the problem is not because of them.) labeledImage = bwlabel(binaryImage, 8); % Label each blob so we can make measurements of it blobMeasurements = regionprops(labeledImage, Ibw, 'all'); numberOfBlobs = size(blobMeasurements, 1); I got this error message: ??? Error using ==> subsindex Function 'subsindex' is not defined for values of class 'struct'. Error in ==> test2 at 129 numberOfBlobs = size(blobMeasurements, 1); please help, thank you! :] matlab share|improve this question asked Apr 8 '12 at 8:00 Alon Shmiel 171134695 add a comment| 2 Answers 2 active oldest votes up vote 13 down vote accepted You're getting that error because you have created a variable called "size" which shadows the built-in function SIZE. Instead of calling the function to compute numberOfBlobs, MATLAB instead tries to index the variab