Create a String Array
显示 更早的评论
I am trying to create a string array of elements ranging from A1 to H12, where the first 12 elements are A1 - H1, next 12 are A2 - H2 and so on. I want to do this without having to type these out in a comma separated list. Here is my failed attempt at programming this.
Rows = {'A','B','C','D','E','F','G','H'};
Cols = [1:1:12];
wellNames = NaN(1,96);
count = 1;
for y = Cols
ystr = sprintf('%d', y);
for x = Rows
tempstr = num2str(cell2mat([x, ystr]));
wellNames(:,count) = tempstr;
count = count + 1;
end
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Lengths and Angles 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!