how can i store all the different values in one variable or matrix?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi all! I'm getting an error: Unable to perform assignment because the size of the left side is 1-by-24 and the size of the right side is 1-by-63.
I know why I'm getting this error. but is there a way to store all the char data in example variable? even though they have different columns dimensions
for n = 1:length(i)
example(n,:) = decode(matrix(n,:), x)
end
댓글 수: 0
채택된 답변
Ameer Hamza
2018년 5월 1일
Using matrix, it is not possible, unless you are ready to add zeros at the end of the vector to make length equal. The proper way to do this is to use cell array. Do it as follow,
example = cell(1, length(i));
for n = 1:length(i)
example{n} = decode(matrix(n,:), x)
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!