MATLAB: Create a variable to store sets variables I would like to create a variable that stores a set of numbers for an arc (a,b). S(a,b) = {1,2,3,4,5}S(b,c) = {3,4,5} etc but I dont know how to write it in matlab. Please help Best Answer Sounds like you need a cell array: S{set_no} = [2 3 5 6]; S(2} = [1 5 6 3 64 23]; Related SolutionsMATLAB: Remove redundancy values from matrix S=[2 3 4 5 4 4 4;2 3 4 2 3 4 5;3 4 4 5 5 2 3];S1 = unique(S); MATLAB: I want to traverse an array in an ‘inverse s’ order and store in a single row array is there any matlab function or code for this?eg[1 2 3; 3 4 5; 4 5 1] becomes [1,2,3,5,4,3,4,5,1] >> A = [1,2,3;3,4,5;4,5,1];>> A(2:2:end,:) = A(2:2:end,end:-1:1);>> reshape(A',1,[])ans = 1 2 3 5 4 3 4 5 1 Related QuestionPutting the combinations of a sequence in an cell arrayHow to create an array that counts the number of consecutive repeating numbers in a given arrayGet a field value from all elements of a structure
Best Answer