MATLAB: Multiply a scalar to all column of a table MATLABmultiplyscalartable I've a table, T. I want to mulitply a scalar to all values in the table (similary to scalar multiplication of a matrix e.g. 2*rand(5,5)). I tried 10*T, it doesn't work. Any suggestions? Best Answer Suppose T is your table variable with it's variable name Var1T.Var1 = 10*T.Var1; Related SolutionsMATLAB: Add a variable to a table If your table is named T, and your workspace variable is named k, and you want the new variable in the table to be named k, then it's justT.k = k MATLAB: Choose numerical type for table2array output Seomthing like thisT=table;T.var1=ones(10,1,'uint8');T.var2=1000*ones(10,1,'double');array = structfun(@double, table2struct(T, 'ToScalar', true), 'uni', 0);array = struct2array(array); Related Question[GIS] Iterating polygons on a SpatialPolygonsDataFrame in R with readWKTEquivalent of isfield for tablesCreate a table of one vector and a matrixExtract Variable/column with variable name from tableCombining functions and commands in to one script
Best Answer