cell array concatenation problem
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi
I am not sure what I am doing wrong. I have the following code.
BWL = [200 350 500 1000]*1E6;
filename = cell(4,2);
filename(:,1) = cellstr(strcat({'Sub Bandwidth '}, num2str(BWL'/1E6,'%-d')));
filename(:,2) = strcat(filename(:,1),' D1M ');
filename(:,1) = strcat(filename(:,1),' D50 ');
This gives me the following output.
filename =
'Sub Bandwidth 200 D50' 'Sub Bandwidth 200 D1M'
'Sub Bandwidth 350 D50' 'Sub Bandwidth 350 D1M'
'Sub Bandwidth 500 D50' 'Sub Bandwidth 500 D1M'
'Sub Bandwidth 1000 D50' 'Sub Bandwidth 1000 D1M'
This is what I want. Now when I add the following line of code.
filename = strcat(filename,{' MHz VISA _9500.mc'});
filename =
[1x39 char] [1x39 char]
[1x39 char] [1x39 char]
[1x39 char] [1x39 char]
[1x40 char] [1x40 char]
I don't understand why I end up with a cell array of chars instead of strings? Every line up until this point used strcat and output a cell array of strings. Can anyone help me understand what is happening and whether what I have here is the best way/fewest lines of code to get what I want? Thanks!
댓글 수: 0
답변 (1개)
Azzi Abdelmalek
2013년 5월 13일
편집: Azzi Abdelmalek
2013년 5월 13일
What is the problem? your screen is too small to display the whole string
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!