How to combine 3 [nx3] matrices

조회 수: 2 (최근 30일)
eevee
eevee 2014년 10월 21일
댓글: Mohammad Abouali 2014년 10월 22일
Hi all,
I've got 3 matrices [nx3], made up from xyz files, and I need to combine them into:
x=[a(:,1),b(:,1),c(:,1)];
y=[a(:,2),b(:,2),c(:,2)];
z=[a(:,3),b(:,3),c(:,3)];
before I can plot all these into 1.
I would like to thank Mohammad for advising me with the above code to kick start with combining my 3 bathymetry files. However, MATLAB keeps giving me an error message:
Error using horzcat CAT arguments dimensions are not consistent.
Thanks
Eve

답변 (1개)

Image Analyst
Image Analyst 2014년 10월 21일
Eve:
They have different numbers of rows. Put these lines before the error:
whos a
whos b
whos c
Tell me what it says in the command window.
  댓글 수: 4
eevee
eevee 2014년 10월 22일
Hi Mohammad,
Thanks for replying. I've done that and MATLAB gave me a warning message as follows:
Warning: Duplicate data points have been detected and removed - corresponding values have been averaged.
But at least I've got the plot. HAHA.
Thank you very much for your help.
Appreciate it alot! It's really awesome to have wonderful support in this community to help me kick start at this software.
Millions thanks! You guys are all awesome! :)
Eve
Mohammad Abouali
Mohammad Abouali 2014년 10월 22일
Well, I am not working for MATHWORKS in any capacity. But one of the things that I really like about MATLAB is their documentation. It is really nicely written. Try to get some of the PDF and just read them through them.
And this Support section is also very nice. It is indeed very well supported software.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by