How to Split one Large Matrix Into Smaller Matrices

Hello,
I have some magnetic field coil data that I need to analyze. The issue is that the data format of the text file has three columns as shown in the image below.
When I import it to MatLab it gives me a 150081x5 matrix and that's no good because although in the image the x-coordinate is only -270, it goes up by 1.8 until it reaches 270. Somehow I need to take all of the data points for Z and Bx and that corespond to x=-270 and make them a 150081x1 matrix where the 1 is -270. Eventually the endgoal is to print 2D heatmaps of these values so that we can look at the homegeneity of the magnetic fields at certain locations inside the plane.
What would be the best way to go about taking my currently ugly data and putting it into a usable format?

2 Comments

@David Bloom: please click the paperclip button and upload a sample file for us to work with.

Sign in to comment.

Answers (1)

What would be the best way to go about taking my currently ugly data and putting it into a usable format?
One Way:
data_file=importdata('David.txt');
data_main=data_file.data;
data1.png
Now do whatever you want with data_main, having 15080 rows and 4 cloumns (considering serial numbers also as a column). You can easily acess any rows or column data from data_main.
Hope you get the sufficient hints!

1 Comment

This is completely useless. It's like you only read the "import" part of my question. I know how to import the data to matlab, the difficulty is in importing it so that instead of one column having the same value of x repeated 500 times with different values of z and bx and then moving on to the next value, to just have a 3D matrix which has each point in space designated by an (X,Z) to indicate location and a Bx value to represent strength of magnetic field at that point.

Sign in to comment.

Categories

Asked:

on 29 Aug 2019

Commented:

on 29 Aug 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!