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