how can concat cell array with array?
조회 수: 1 (최근 30일)
이전 댓글 표시
for example i have cell arrays s{i} ,i want s{i}s pose in one column and another vector like f=[3 4 .....] pose in another column .
댓글 수: 0
답변 (2개)
Cedric
2013년 10월 19일
편집: Cedric
2013년 10월 19일
s = {1; 2; 3; 4} ; % Column cell array.
f = [10 20 30 40] ; % Row numeric array.
c = [s, num2cell(f.')] ;
댓글 수: 4
Cedric
2013년 10월 19일
If you want to concatenate horizontally the content of cells of s1 and the output of f (assuming that f is a function), their number of columns must match. This means that you have to check that f outputs a 7x1 vector (and not 1x7, otherwise you have to transpose it).
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!