Merging two vectors (via horzcat) turns everything into zero
이전 댓글 표시
Hey everybody! I've stumbled across a serious problem and I cannot fathom if I'm just being too stupid. I have 19 variables called QM1, QM2, QM3 etc., all having one row but different number of columns, such as 1x40 or 1x50. They're all of double-type and consist of values ranging from -1x10^1 to -1x10^8, so all non-zero numbers. I'm trying to merge all of them into one big vector, plotting their absolute value over the corresponding velocities that I have as well on a double-log scale and creating a line of best fit. However, when either using
QMall=horzcat(QM1,QM2,QM3,...,QM19);
or
QMall=[QM1 QM2 QM3 ...];
and then looking at the values of the newly formed vector (which has at least the correct dimension of 1x718), suddenly 99% of the numbers have turned to (1.0e+09 *) 0.0000. The manual creation of the big vector seems to work if I do it gradually, such as QMall=[QM1,QM2,QM3] and then QMall=[QMall QM4 QM5] and so on up until the last two or three variables which then turn into zeros. Has anyone ever encountered this problem before? What I don't get is that it used to work in the beginning, but suddenly it doesn't. Your help would be much appreciated.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!