137 questions
1
vote
1
answer
136
views
Python read matlab .mat file containing table
I'm trying to read a matlab .mat file (v7.3) from python. The thing is one of the field in the .mat object is a table (7x6) with named columns, and every time I read the object I only get a 1x6 array ...
1
vote
1
answer
56
views
Why are my table columns not named properly?
I need to make a table that has column names "Radii", "SurfaceA", and "Volume". But when I display the table it names the columns "Var1", "Var2", and &...
2
votes
1
answer
69
views
Splitting up a matlab table in vectors
i'm fairly new to matlab and i'm looking for a way to evaluate data in a table. There's an excel table as illustration attached.
My measurements are savedin a txt-file divided by cycle numbers. All ...
0
votes
1
answer
62
views
What is the difference between readall and read+hasdata?
I found that the functions of readall and read+hasdata seem to be exactly the same. read+hasdata is a loop body, is it less efficient? So in any case you should avoid using read+hasdata? Why does ...
2
votes
1
answer
117
views
Iterate through a CSV and assign data into new tables, based on unique IDs
I'm attempting to iterate through a CSV file and assign the data within each row into new tables, based on unique IDs. The unique IDs are found within the 'Unit' column - please find the formatting of ...
0
votes
1
answer
774
views
Matlab add string variable as column in table
I'm trying to use YOLOv4 in MATLAB R2022b to carry out detections on all images in a directory, and append results to a text file.
I can append just the detection results to each line, but when I try ...
2
votes
2
answers
133
views
Rearrange MATLAB table variables (Release 2016)
I have a table in MATLAB with variable titles equal to:
titles = {'TZ_1', 'TZ_2', 'TZ_3', 'DATE'};
Is there any way to move change the data to have the DATE before TZ_1?
titles = {'DATE', 'TZ_1', '...
0
votes
1
answer
78
views
Plotting continuous (not overlapping) timeseries data from different files on one graph in Matlab
I am writing Matlab code to open date files from a continuous air sampling instrument and could use help cleaning it up/formatting the plots correctly.
This is my code currently,
#importing data
A101 ...
0
votes
1
answer
120
views
Why do I get a complex number when I use 'uitable' in MATLAB?
I have data file included both type of numbers, real (fractions and integers) and complex. But when I use 'uitable' all data will turn to be complex (of course 0i as imaginary part). see the figure
...
1
vote
1
answer
113
views
Unstacking with 2 conditions
I am using MATLAB 2021b and I have the following data:
ID = {'a','a','a','a','b','b','b','b'}';
DATE = [2010,2010,2011,2011,2011,2011,2012,2012]';
FIELD_ID = {'f1','f2','f1','f2','f1','f2','f1','f2'...
1
vote
1
answer
150
views
Count up variable/table name with while loop
I'm reading multiple tables with the same measurement variable. I want to compare the variables of tables with each other. Because there are so many tables and with each one I'm doing the same things, ...
0
votes
0
answers
914
views
convert MATLAB table column from array of doubles to string
I'm having trouble converting a column in my MATLAB table. Each row of this column contains a 802x1 double. For each row in this column, I'd like to merge all of the numbers into one large string (...
0
votes
1
answer
171
views
Creating Table with proper format in Matlab for YOLO v3 example?
Matlab has a fairly extensive suite of examples for object detection using Neural Networks.
In the YoloV3 example, the tools need as input a table with a particular format. I have a custom dataset, ...
1
vote
1
answer
6k
views
Have Matlab's "readtable" recognize column headings?
I have the following CSV file with column headings on line 1:
Test.csv
--------
Prj , Cap
A , 1
A , 2
H , 4
H , 5
I tried to read this into a table, but I'm having trouble making ...
2
votes
2
answers
308
views
Creating mesh from 3-column table in matlab
I have a table with values extracted from a csv I want to make a contour plot from.
Let's use this table as an example
tdata.x = [1;2;1;2];
tdata.y = [3;3;4;4];
tdata.z = randn(4,1);
tdata=...
2
votes
1
answer
2k
views
making a Table in Matlab
I'm trying to make a table in Matlab and initialze it with zeros so I did it in this way:
z =zeros(4,4);
exTab = table(z,'RowNames',{'row1' 'row2' 'row3' 'row4' }, 'VariableNames',{'column','column2','...
3
votes
2
answers
199
views
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 = ...
0
votes
1
answer
87
views
Table fields digit change when replacing data of different types
Based on this post (Table fields in format in PDF report generator - Matlab), I run the script on a table. In the script, I extract one column, run the function on it, and replace the old column with ...
0
votes
0
answers
102
views
MATLAB Adding 2 horizontal arrays to a table as labels and a row, as opposed to 2 columns
I have 2 horizontal arrays I'm trying to add to a table
X = [1 2 3 4 5]
Y = [6 7 8 9 10]
and I'm trying to add them both to a 2x5 table such that the labels are X and Y is added as a row I.E.
1 2 3 4 ...
0
votes
0
answers
45
views
How to get a collective output of multiple loop run using a selection condition in Matlab?
I have a table (L-arrival) of 279 rows and 252 columns. Only the first column has values while others are just NaN. The cells in the first column have multiple values (i.e. some have 1, some have 4 ...
3
votes
1
answer
512
views
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 ...
0
votes
0
answers
944
views
How to Create Matlab Tables with Symbols in the Title and Missing Blank Elements
I am wondering if it is possible to generate a "pretty" table like the one shown below? So far, it seems that generating tables and then displaying them using table() and uitable() is a bit ...
1
vote
1
answer
133
views
How can change ColumnName of table with for loop in matlab?
x = [];
x = ['A':'Z'];
for i='A':'Z'
for j='A':'Z'
x = [cellstr(x),[i,j]];
end
end
for i=1:100
app.UITable.ColumnName ={x(i)};
end
I want to change ColumnNames with x characters ...
0
votes
1
answer
246
views
MATLAB Table Datetime loop indexing
I am trying to take my excel spreadsheet and import it into MATLAB (already accomplished that), and then using for-loop indexing to create arrays of the data for a give day containing.
So ideally I ...
1
vote
1
answer
1k
views
The readtable() function is deleting the first three rows from my table
While writing my code, I realized that the first 3 rows from a table I had recently written to a .txt file were missing. I had created the table in a Matlab code file and wanted to use it in a ...
0
votes
1
answer
284
views
write matrix to one column of a table - matlab
>> x = 'x';
>> y = [1,2,3,4];
>> T = table({x},{y});
>> writetable(T,'T.txt','Delimiter','\t')
when I open T.txt the different elements of y are written in separate columns:
...
1
vote
2
answers
4k
views
How to display a matlab table in a Matlab App?
I am building an app where the user can select some parameters and press a button "update", which trigger a table to be create. Let's say a table named A.
Now I would like to display this table in a ...
0
votes
1
answer
241
views
How to create matrix from data in a text file MATLAB?
I have a text file called epsi_20_20. In this file there is a large table with data. I would like to be able to create in MATLAB a matrix containing only the values of the last six columns. How can I ...
0
votes
2
answers
1k
views
Is there a way to create a table with multi-line column names?
I am attempting to create a table that has the following format of multi line heading for the columns
|Col1 Co2 Col3|
|Col1 Co2 Col3|
Tried this using the example and adding a | between 1st and 2nd ...
1
vote
1
answer
92
views
Delete table row when number from one column is within a string in another column
Below presented a table where the third column is a cell array of doubles and the last column is a cell array of chars. I would like to delete row number 248 based on the condition that 'Subject moved ...
1
vote
1
answer
302
views
How to pre-allocate a table with non-scalar sized variables?
I was playing around with tables as a replacement for regular numerical arrays for various reasons, when I came across the following challenge: how to (pre-)allocate a table with non-scalar variables?
...
0
votes
1
answer
470
views
How to index table in Matlab based on regular expressions for variable headers?
I am attempting to read in a CSV file that has data in multiple columns that are not applicable for the program I am attempting to run. I'd only like to read from the table from columns that contain '...
-1
votes
1
answer
999
views
How to remove NaN from MATLAB tables? [closed]
I am getting NaN values when I am evaluating a semantic segmentation network. How can I replace NaN with 0?
metrics =
semanticSegmentationMetrics with properties:
ConfusionMatrix: ...
2
votes
1
answer
321
views
Create table with mixed data types from arrays
I would like to compose several arrays into one table. Since they have different data types, it seems not very straightforward.
Consider this simple MWE:
daysTotal = 2;
hoursTotal = ...
3
votes
1
answer
1k
views
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 ...
1
vote
1
answer
183
views
How to determine the number of digits of a number in a table
I am trying to determine the number of digits of a number in a table. For example if I have a table like this:
4 200 50 1236
69 54 285 1
1458 2 69 555
The answer would be
...
0
votes
1
answer
97
views
Group 4 tables into one, with each table as one column?
I have 4 tables (A,B,C,D) in Matlab with 102 columns (e.g. X, Y, W, Z), all containing 52000 rows (e.g. 0,1,2,...).
I want to merge them into one big table containing all of the data.
This is the ...
1
vote
1
answer
69
views
Unable to create an array from a table
I'm trying to load an external CSV file using MATLAB.
I managed to download it using webread, but I only need a subset of the columns.
I tried
Tb = webread('https://datahub.io/machine-learning/iris/...
2
votes
3
answers
251
views
Return the maximum value of every subgroup in a table
I have a section of table like this:
X
Y
Value
1
2
6.9
1
3
6.8
1
4
8.1
2
1
7.2
2
3
11.7
2
4
16
3
1
22.6
3
2
20.5
3
3
18.1
…
…
…
For each group of rows having the same X, I need to select only the row ...
1
vote
1
answer
2k
views
How to give a title to a matlab table?
I have a few tables, that after producing within the command window I need to print-screen into a word document. Is it possible to give the table a title so it does not need further labelling within ...
2
votes
2
answers
934
views
Matlab `rowfun` function with multiple outputs: Safe to assume row order?
I tried providing a function to rowfun that returns multiple-row output, of the same height as the input. It seems to work as expected.
% Example table with 2-column-array as a single data field
x = ...
1
vote
2
answers
598
views
Do MATLAB tables remove the need for dictionaries?
MATLAB tables let you index into any column/field using the row name, e.g., MyTable.FourthColumn('SecondRowName'). Compared to this, dictionaries (containers.Map) seem primitive, e.g., it serves the ...
0
votes
1
answer
184
views
How to remove table data based on comparison between different columns in another table in MATLAB?
I have 2 tables in MATLAB- table A and table B, each having different dimensions (different no. of rows and columns). The first column of table A has the Date and time in format like 2018-11-01 12:00:...
3
votes
2
answers
189
views
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 ...
3
votes
2
answers
207
views
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 ...
4
votes
2
answers
5k
views
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 ...
0
votes
1
answer
291
views
Matlab categorical table variables: Speed? Use in join keys?
I've dipping my toe into Matlab's categorical variable pool in the context of Matlab tables. Actually, I may have wandered into that territory in the past, but if so, it would have been in a ...
2
votes
1
answer
11k
views
Writing a table to csv file in Matlab
I have a table. A sample of a cell is as below:
var = [1 16 18 17; 1 10 15 6; 78 10 26 43; 9 13 91 4; 1 17 81 23];
I also want to add the column id to this like below:
id=[1;1;1;1;1];
Now i want to ...
2
votes
1
answer
187
views
Write a table object into csv in matlab
I have a table object in Matlab with cells as shown in the snapshot:
The cells inside Land and Seamark are as below:
The class of the objects are as below:
>> class(FileData.gTruth.LabelData....
1
vote
1
answer
2k
views
Importing Data from a .txt file into Matlab
First of all thank you for reading my question.
I am trying to import data from a file with following format into Matlab:
#Text
#Text: Number
...
#Text: Number
Set1:
1 2
3 4
Set2:
5 ...