How do I make a code that store large amount of information from excel into a matrix?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Mohammad Danial Bin Kamarul Zaman
el 15 de Feb. de 2019
Comentada: Kevin Phung
el 15 de Feb. de 2019
I'm trying to recreate the following data in excel sheet and store them in a matrix using MATLAB. Unfortunately, I could not think of the best way to handle this amount of information using MATLAB. Below I have attached the current code that I have and the excel sheet.
clear
clc
numData1=xlsread('Original2.xlsx','original');
FrontFaceElements1=numData1(:,1);
FrontFaceElements1_stress=numData1(:,2);
%Total elements and nodes
%Assemble all nodes and its coordinates in a single matrix
TotalNodes=numData1(:,13);
TotalNodesX=numData1(:,14);
TotalNodesY=numData1(:,15);
TotalNodesZ=numData1(:,16);
TotalNodesMatrix(:,1)=TotalNodes;
TotalNodesMatrix(:,2)=TotalNodesX;
TotalNodesMatrix(:,3)=TotalNodesY;
TotalNodesMatrix(:,4)=TotalNodesZ;
TotalElements=numData1(:,18);
TotalElementstress=numData1(:,19);
%Coordinates of each elements
admittedly, I feel a bit stuck about this. Rather than continuing, I’m wondering if I could lean on your expertise and insights to learn how to do it. Appreciate any form of help. Thank you soo much :)
2 comentarios
Respuesta aceptada
Kevin Phung
el 15 de Feb. de 2019
Are you trying to do this:
m = numData1(:,[1:12]);
this should give you a matrix with the first row corresponding to the element number, and the other columns being the node data
2 comentarios
Kevin Phung
el 15 de Feb. de 2019
glad to have helped :).
Here's some documentation that might be even more helpful to you:
https://www.mathworks.com/help/matlab/math/array-indexing.html
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Export to MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!