Questions tagged [matlab-table]

Fro questions about MATLAB's table data class.

Mathworks tables documentation

136 questions
1
vote
1 answer

Select clustered rows from a table

I'll try to write my problem in a list to be more understandable: I have a matlab table T of size 1000x30. All the data in the last column called 'Class' in the table has certain values of integers ranging from 1 to 20. So some rows will have the…
Tak
  • 3,536
  • 11
  • 51
  • 93
1
vote
2 answers

Stacked bar from Table in matlab

I want to create a stacked bar chart from a table. Here there is a MWE of the type of table I am looking at: clear all; country1=rand(5,1); country2=rand(5,1); country3=rand(5,1); country4=rand(5,1); country5=rand(5,1); date=1990:1994; …
msh855
  • 1,493
  • 1
  • 15
  • 36
1
vote
2 answers

How to make calculations on certain cells (within a table) that meet specific criteria?

I have the following code: L_sum = zeros(height(ABC),1); for i = 1:height(ABC) L_sum(i) = sum(ABC{i, ABC.L(i,4:281)}); end Here my table: Problem: My sum function sums the entire row values (col. 4-281) per date whereas I only want those…
John
  • 71
  • 7
1
vote
1 answer

Adding multiple rows of a table to another table

I have a table as below : (This is a few lines from my table) T = table({'A';'A';'A';'B';'B';'B';'C';'C';'C';'C'}, {'x';'y';'z';'x';'w';'t';'z';'x';'t';'o'},[5;1;2;2;4;2;2;5;4;1], ... 'VariableNames', {'memberId', 'productId','Rating'}); T: A…
Eli
  • 83
  • 8
1
vote
1 answer

reading datenum instead of datestr from excel file

I am trying to read a test table from an excel sheet , my excel sheet looks something like this Building location start_date start_time end_date end_time number Test_Building 1.08 12.06.2016 19:00 12.06.2016 19:30 …
Novice_Developer
  • 1,432
  • 2
  • 19
  • 33
1
vote
1 answer

Create an index to table

I have a table T as below: T = table({'A';'A';'B';'B';'B';'B';'C';'C';'D';'D'},... {'xd';'z';'x';'y';'z';'w';'x';'wh';'z';'w'},... [4;2;4;1;2;5;2;1;1;5], ... 'VariableNames', {'memberId', 'productId','Rating'}); T =…
Eli
  • 83
  • 8
1
vote
1 answer

Keep similar rows when joining tables MATLAB

I have the following problem in MATLAB. f1 [4757*256] table f2 [4757*512] table f3 [14073*1024] table While I can easily join f1 and f2 with f1n = join(f1,f2,'Keys','RowNames'); I cannot do the same with f1 , f3 in f3n =…
yas yasi
  • 215
  • 1
  • 6
  • 16
1
vote
1 answer

Organising large datasets in Matlab

I have a problem I hope you can help me with. I have imported a large dataset (200000 x 5 cell) in Matlab that has the following structure: 'Year' 'Country' 'X' 'Y' 'Value' Columns 1 and 5 contain numeric values, while columns 2 to 4 contain…
1
vote
2 answers

Merge different sized arrays into a table

Overview I am currently working with a series of .txt files I am importing into MATLAB. For simplicity, I'll show my problem conceptually. Obligatory, I'm new to MATLAB (or programming in general). These .txt files contain data from tracking a ROI…
Dylan Fox
  • 15
  • 4
1
vote
1 answer

Sparse table in MATLAB, is it possible?

\ am dealing with a matrix in MATLAB which is sparse and has many rows and columns. In this case, the row and columns of the matrix are the ids for particular items. Let's assume them as id1 and id2. It would be nice if the ids for rows and columns…
Yas
  • 811
  • 4
  • 11
  • 20
1
vote
1 answer

merge two tables with No variables in common

I have two tables of different row size (which may vary). The variable name is different (no variable name in common). When I try to join these I get an error that no keys are common. Is there a command that would join these two tables? Or how can…
Erik
  • 71
  • 2
  • 12
1
vote
2 answers

MATLAB fastinsert error

I have a simple table in SqlServer database, simSQLTable. The column headings are: index, del_date, name I have a table in MATLAB mytbl, with one row: num deldate myname --- ------- ------ 1 '07-02-2015 00:00:00.0' 'JenZ' mycolnames =…
JenZ
  • 129
  • 1
  • 1
  • 9
1
vote
2 answers

Index of Max Value from by grouping using varfun

I have a table with Ids and Dates. I would like to retrieve the index of the max date for each Id. My initial approach is so: varfun(@max, table, 'Grouping Variables', 'Id', 'InputVariables','Date'); This obviously gives me the date rather than the…
1
vote
2 answers

How to apply an aggregating function to groups of table (or dataset) rows?

Suppose I have some table (or dataset) object A that includes some factor X (having n distinct values, or "levels") among its variables. Also suppose I have some custom aggregating function agg that takes as input a sequence of rows, and returns a…
kjo
  • 33,683
  • 52
  • 148
  • 265
1
vote
2 answers

MATLAB: ismember vs isequal

If A and B are tables (or datasets) having the same the same columns (and in the same order), then an expression like ismember(A(:, somecols), B(:, somecols)) will produce a boolean array suitable for indexing A with, as in A(ismember(A(:,…
kjo
  • 33,683
  • 52
  • 148
  • 265