MATLAB: How to access data from structure MATLABstatisticsStatistics and Machine Learning Toolbox Hi, I have data in structure: A.B.C C is also structre with size 23×5 I want to access 4th column of each row (its a double values). How to do this with out for loop. Best Answer Please try this Command to get the 4th columnA.B.C(:,4) % To get 4th column Related SolutionsMATLAB: Accessing elements of Structure Simpler than you think I guess:ElementsOfInterest = [2 5 1];for i=1:length(fields) s.(fields{i})(ElementsOfInterest(i));endWorks for me.HTH MATLAB: How to store data from second row &second column onwards Here is one way:data = [1 2 3; 3 4 5; 6 7 8];label = {'A','B','C'};labelAndData = cell(4,4);labelAndData(1,2:4) = label;labelAndData(2:4,1) = label';labelAndData(2:4,2:4) = num2cell(data) Related QuestionHow to call a certain part of a matrix which is a value of a field of a structureHow to access data from “Structure within structures”How to access every alternate field of sldvData structureStructuresStructure
Best Answer