### Translated by

이 페이지의 내용은 영어에서 자동 번역되었습니다. 자동 번역 기능을 해제하려면 "<a class="turn_off_mt" href="#">여기</a>"를 클릭하십시오.

## How do I make a code that store large amount of information from excel into a matrix?

### Mohammad Danial Bin Kamarul Zaman (view profile)

on 15 Feb 2019
Latest activity Commented on by Kevin Phung

on 15 Feb 2019

### Kevin Phung (view profile)

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
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 :)

Kevin Phung

### Kevin Phung (view profile)

on 15 Feb 2019
so what are you trying to do?

### Mohammad Danial Bin Kamarul Zaman (view profile)

on 15 Feb 2019
Good question haha. I'm trying to create a loop matrix that starts from 1X1 (value 15 as shown in the picture) to the final row lets say nX1. At the same time, it saves all the nodes corresponds to the element as shown in the figure.

### Kevin Phung (view profile)

on 15 Feb 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

### Mohammad Danial Bin Kamarul Zaman (view profile)

on 15 Feb 2019
yes! thank you soo much. I really appreciate it. I'm surprised, why didn't I thought of that.
Kevin Phung

### Kevin Phung (view profile)

on 15 Feb 2019
Here's some documentation that might be even more helpful to you:
https://www.mathworks.com/help/matlab/math/array-indexing.html

Translated by