index exceeds matix error
Afficher commentaires plus anciens
hi, i have created a mesh in a software and want to upload that into matlab using NIRFAST software, when i upload my node and element files into matlab an error occurs showing that index exceeds the matrix. To give you guys a clear view node file is a NX4 matrix and my elem file a EX4 matrix. N,E are the number of nodes and elements. where do you think the problem may lie. I am new to matlab please help me.
regards, ram
4 commentaires
Amit
le 26 Jan 2014
Can you elaborate a bit more? Like when the error occurs? what the error is etc.
Image Analyst
le 26 Jan 2014
Copy and paste all the red text in the error message. I mean ALL of it, don't just snip out a small part of it.
Ram Siddardha
le 30 Jan 2014
Ram Siddardha
le 30 Jan 2014
Réponses (1)
Amit
le 30 Jan 2014
(mesh.nodes(:,1:3)-repmat(coord(i,1:3),size(mesh.nodes(:,1:3),1),1)).^2;
The code should work unless coord or mesh.nodes have less than 3 columns. That is where I see this error thrown.
Before going in the loops, check
size(mesh.nodes,2)
size(coord,2)
and make sure that you get a number 3 or bigger than 3 for both of them.
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!