Matrix help
이전 댓글 표시
I have a matrix of letters, however in the command window the letters all have e.g 'B/H' instead of just B/H. my code at the moment is
function dissertationmatrixletters
C = cell(16);
for i=1:2:3
C(i,2)={'-B/H'};
end
for i=1:2:3
C(i+4,2)={'B/H'};
end
disp(transpose(C));
Does anybody know how to do this?
Kind Regards
Dan
채택된 답변
추가 답변 (2개)
Oleg Komarov
2011년 4월 14일
The apostrophes just indicate that you're using a cell array to store elements.
If you access the content of the cell, you'll get B/H (w/o the apostrophes).
It depends what you need the array for. For printing purposes you could store:
A = [' B/H -B/H'
'-B/H B/H'];
But then it's a 2 by 10 char array.
Walter Roberson
2011년 4월 14일
0 개 추천
댓글 수: 2
Oleg Komarov
2011년 4월 14일
I just read it...Why would anybody care about the apostrophes in the command window?
Walter Roberson
2011년 4월 14일
Look, are you here for the beer or are you here to ask questions?
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!