Creating a table with matrices and arrays as elements
34 次查看(过去 30 天)
显示 更早的评论
评论: Mohammad Hussein Yoosefian Nooshabadi
2021-3-6
Hi, Hope you're safe and fine.
My question is how to create a table whose elements are not necessarily of the same rows. For instance, I have attached a built-in table from "Monocular Visual Odometry" example of MATLAB. In this table, the first element is a number, the second one is a 1x3 vector of location, and the thrid one is a 3x3 matrix of rotation.
Any ideas are appreciated!
0 个评论
采纳的回答
Stephen23
2021-3-6
编辑:Stephen23
2021-3-6
Lets have a look at the data:
S = load('visualOdometryGroundTruth.mat')
T = S.groundTruthPoses
The curly braces in the 2nd and 3rd columns tell us those numeric arrays are in a cell array. So lets do that:
VId = [2;4;8];
Loc = {[2,22,222];[4,44,444];[8,88,888]}; % cell array
Ori = { 2*rand(3); 4*rand(3); 8*rand(3)}; % cell array
out = table(VId,Loc,Ori)
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!