num2str use for a product of two queried variables
조회 수: 1 (최근 30일)
이전 댓글 표시
With a for loop, num2str works fine querrying a single variable array:
for i = 1:runs
a = num2str(data.x(i));
end
But when I try to use as I needed, i.e. multiply data.x with data.y:
for i = 1:runs
a = numstr(data.x.*data.y(i));
end
I get this error:
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
Note: data.x and data.y are both arrays of size 10x1; and the product of the two is only allowed along this "a" line.
Thanks for any tip on this!
댓글 수: 1
Matt J
2022년 4월 20일
COpy/paste the full errror message and, ideally, post enough code that we can run and reproduce the error.
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!