MATLAB: Subtracting column values in Matlab tables matlab function Hi All, I have a table in matlab with 84 rows and 3 columns. I want to subtract values in column 3 from column 2. How do I do that. Thanks, Best Answer YourTable{:,2} - YourTable{:,3}assuming that they are the same data type.(EDIT: corrected a minor typo in the first term) Related SolutionsMATLAB: Add columns to tables with loops See this examplet = array2table(rand(3)); % example tablerows = compose('Bar %d', [1 2 3]);rows = vertcat(rows{:});T = [table(rows, 'VariableNames', {'labels'}) t]; MATLAB: How to find the frequency of unique rows in 3 columns of a table Var1 = {'Car';'Dog';'Car';'TV';'TV';'TV';'Car'} Var2 = {'red';'blue';'red';'green';'yellow';'green';'red'}; Var3 = {'X';'Y';'X';'Z';'Z';'Z';'X'}; t = table(Var1,Var2,Var3); [tt ia ic] = unique(t); Var4 = histc(ic,unique(ic)); tt.Var4 = Var4;tt is the required table. Related QuestionRandom draw with replacement in pairs.Display values from matfileHow to separate the arrays when making a table
Best Answer