首先感谢您阅读我的问题。
我正在尝试将具有以下格式的文件中的数据导入 Matlab:
#Text
#Text: Number
...
#Text: Number
Set1:
1 2
3 4
Set2:
5 6
7 8
...
我想将这些数字转换为以下形式的两个矩阵:
(1 5
3 7)
和
(2 6
4 8)
我开始只构建这两个矩阵中的第一个。
Winkel = 15;
xp = 30;
M = readtable('Ebene_1.txt')
M([1:4],:) = [];
M(:,3) = [];
for i=0:Winkel-1
A = table2array(M((2+i*31:31+i*31),1))
end
但是这个解决方案只给了我无法转换为法线向量的单元阵列。
I also tried to use the importdata
command, but could not find a way to get this to work either. I know there are many other questions similar to mine, but I could not find one where all the data were in a single column. Also, there are many Matlab-commands for importing data into Matlab and I am not sure which would be the best.
First time asking such a question online so feel free to ask me for more details.