Vertcat Error in creating a junction
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Walter Roberson
le 19 Déc 2024
Error using importdata (line 71)
Unable to open file.
Error in
Create_BNJunction_OP (line 20)
bnnt_L = importdata('bnnt_L.xyz', ' ',4);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Réponses (1)
Ayush
le 22 Déc 2024
Modifié(e) : Ayush
le 22 Déc 2024
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!
0 commentaires
Voir également
Catégories
En savoir plus sur Data Type Conversion dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!