Vertcat Error in creating a junction

조회 수: 2 (최근 30일)
Joshua
Joshua 2024년 12월 19일
편집: Ayush 2024년 12월 22일
I will attatch the code I am having a problem with but the jist of it is that I am having a vertcat error and can't seem to solve the problem. I am using imported files since this is for a boron-nitride structure, could those be affecting the code?
  댓글 수: 1
Walter Roberson
Walter Roberson 2024년 12월 19일
Error using importdata (line 71)
Unable to open file.
Error in
Create_BNJunction_OP (line 20)
bnnt_L = importdata('bnnt_L.xyz', ' ',4);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

답변 (1개)

Ayush
Ayush 2024년 12월 22일
편집: Ayush 2024년 12월 22일
In order to investigate the error, you need to provide the required files such as 'bnnt_L.xyz' as running your code is giving the error: "Unable to open file".
However here are some potential cause of "vertcat" error.
This issue occurs when trying to concatenate arrays with incompatible sizes. Given that you're using imported files (bnnt_L.xyz, bnnt_R.xyz, bnnt_M.xyz, etc.), it's likely that the structure of the data in these files could be causing the issue.
So, as you are concatenating multiple data arrays (bnnt_L, bnnt_R, bnnt_M, etc.), and if one of these arrays doesn't have the same number of columns or rows, it can cause a vertcat error.
To debug the issue, you can use "size" function to check the dimensions of your matrices after importing them. You can read more about it here: https://www.mathworks.com/help/matlab/ref/double.size.html
Hope it helps!

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by