Please, find the attached matlab file The first column is the x_coordinates, second column is the y coordinates, the third column and fourth column are the data I want to plot. For my data to be correctly plotted, I need to rearrange my data such that x column will be from 0-2, 0-2, 0-2 … and the corresponding y-coordinates and other data on the previous rows will go with x to the new rows.
For example
Initial matrix
0 0.4 0.6 0.81.5 0.3 0.5 0.71.8 0.5 0.8 0.41 0.7 0.9 0.51 0.5 0.4 0.32 0.2 0.1 0.60 0.8 0.9 0.41.5 0.2 0.1 0.62 0.2 0.4 0.10 0.3 0.4 0.61.5 0.2 0.1 0.91.8 0.4 0.5 0.71.8 0.1 0.2 0.41 0.2 0.4 0.5 2 0.3 0.2 0.3
What I want to acheive
0 0.4 0.6 0.81 0.7 0.9 0.51.5 0.3 0.5 0.71.8 0.5 0.8 0.42 0.2 0.1 0.60 0.8 0.9 0.41 0.5 0.4 0.31.5 0.2 0.1 0.61.8 0.4 0.5 0.72 0.2 0.4 0.10 0.3 0.4 0.61 0.2 0.4 0.51.5 0.2 0.1 0.91.8 0.1 0.2 0.42 0.3 0.2 0.3
Please, I need a code that can help me to achieve this. My original data is the phi.mat attached. Thank you so much.
Best Answer