Questions tagged [matlab-table]

Fro questions about MATLAB's table data class.

Mathworks tables documentation

136 questions
22
votes
6 answers

Display matrix with row and column labels

Is there a convenient way to display a matrix with row and column labels in the Matlab terminal? Something like this: M = rand(5); displaymatrix(M, {'FOO','BAR','BAZ','BUZZ','FUZZ'}, ... {'ROW1','ROW2','ROW3','ROW4','ROW5'}); …
nibot
  • 14,428
  • 8
  • 54
  • 58
4
votes
2 answers

Matlab equivalent of Python Panda's dtypes

If I have a pandas.DataFrame in python I can inspect the data types for the DataFrame with the dtypes attribute. How can I do the same with a Matlab table? I poked around the Properties mechanism but didn't find anything type oriented there.
jxramos
  • 7,356
  • 6
  • 57
  • 105
3
votes
2 answers

Representation of value class in table

If I have a value class like this: classdef MyVal properties foo end methods function self = MyVal(varargin) if nargin > 0 self.foo = varargin{1}; end end end end and…
Patrick Happel
  • 1,336
  • 8
  • 18
3
votes
1 answer

In Matlab, how to apply an 'AggregationFunction' with two variables in unstack?

Objective: I would like to get, for each period and group of a timetable, the result of a given function of var1 and var2 [i.e. the ratio of (the sum of var1 over the group) by (the sum of var2 over the group)] using unstack and a function…
Alexandre C-L
  • 132
  • 11
3
votes
1 answer

Unstacking multiple columns in Matlab

How do I unstack a data in matlab? The unstack for tables only allows me to do it for one column, and does not seem to be able to do a Multi Index solution as available in Python. I was hoping to convert this: into this: in Matlab. Here is code…
whisperer
  • 587
  • 7
  • 13
3
votes
2 answers

Exploit Matlab copy-on-write by ensuring function arguments are read-only?

Background I'm planning to create a large number of Matlab table objects once, so that I can quickly refer to their contents repeatedly. My understanding is that each table variable/column is treated in copy-on-write manner. That is, if a table…
user36800
  • 2,019
  • 2
  • 19
  • 34
3
votes
2 answers

How to join tables in Matlab (2018) by matching time intervals?

I have two tables A and B. I want to join them based on their validity time intervals. A has product quality (irregular times) and B has hourly settings during the production period. I need to create a table like C that includes the parameters p1…
Schae
  • 31
  • 6
3
votes
1 answer

how to import a matlab table in R

I have a matlab .mat file with table data type which I want to import in R. I am using 'readMat' for this and R is reading it as a List. After that is there a way to convert the list into either a dataframe or table format in R? When I use…
3
votes
1 answer

Why does changing the Variable Name of a Table not work if it's the Property of a Class?

In the past, I've been making extensive use of Matlab's table class. This very simple code, inside a script or at the prompt, works as expected: varNames = {'Date_time', 'Concentration_1', 'Concentration_2'}; testTable = array2table(zeros(5,3),…
winkmal
  • 622
  • 1
  • 6
  • 16
3
votes
2 answers

Merge the content of two tables (looking for Matlab or Pseudo Code)

THIS QUESTION IS NOT ONLY FOR MATLAB USERS - If you know an answer to the problem in PSEUDOCODE, then feel free to leave your answer as well! I have two tables Ta and Tb that have different number of rows and different number of columns. The…
WJA
  • 6,676
  • 16
  • 85
  • 152
3
votes
2 answers

How to rename only few variables in MATLAB table?

I want to generate a table but want to set the variable name of only one variable but want all other variables to keep their name. Example, say I have this data: User1 = rand(5,1); User2 = rand(5,1); User3 = rand(5,2); I can now make the table…
EkEhsaas
  • 93
  • 9
3
votes
2 answers

Automatically Create and Name Tables in Matlab from Excel Tabs

I have the following cell array which is a list of some (but not all) of the tab names in an excel file: chosenTabs = 'Screen' 'SectorAbsolute' 'SectorRelative' How do I get it to read off each tab of the excel sheet according to what is on this…
Mary
  • 788
  • 6
  • 19
  • 43
3
votes
4 answers

Test for existance of column in table Matlab

I Have the following table, T: Hold Min Max _________ ___ ____ 0.039248 0 0.05 0.041935 0 0.05 0.012797 0 0.05 0.0098958 0 0.05 0.014655 0 0.05 How can I…
Mary
  • 788
  • 6
  • 19
  • 43
3
votes
1 answer

Faster Matlab Table Creation

I've noticed that creating fairly large tables in Matlab (>10,000 rows) can be quite slow because of a single function called by the constructor, checkDuplicateNames. However, I commonly am sure that the names I'm passing the table are already…
David Kelley
  • 1,418
  • 3
  • 21
  • 35
3
votes
1 answer

What is the best way to preallocate a table in Matlab?

Usually I preallocate using cell(), zeros() or ones() depending on the type of data, but what is the best way to preallocate a table as it can hold various data structures? I am talking about the table() functionality added in Matlab…
florian
  • 604
  • 8
  • 31
1
2 3
9 10