Concatenate the index i within the loop
조회 수: 2 (최근 30일)
이전 댓글 표시
I'm trying to create a list for my legend without hard coding it, but I'm having trouble figure out how to concatenate the number associated with 'i' in my loop.
I'm hoping I'll end up with a list of strings = ['Node 1','Node 2','Node 3'....]
num_labels = 10;
labels = zeros(1,num_labels);
for i = 1:num_labels
labels(1,i) = strcat('Node',i);
end
댓글 수: 1
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!