How can I plot the change in concentration of a 3-D figure ( a drug patch) over time in a (4-D)

2 次查看(过去 30 天)
I have gathered data from a number of files into a 3-D array A(number of files(or the processor that solved ), Time steps- 80000, Z direction steps per timestep-6). I have actually simplified the calculations by assuming that the concentration points at each z step are equal to y and x. I was thinking of adding an x and y dimension in and combine it with the A array, somehow getting rid of the 1st dimension (number of files). A(timesteps,z,x,y)
That is the array which I would like to plot as it will be the size of (80000*(6*20files)120*120). These will only have concentration values at those points, so how would I be able to plot it over an XYZ coordinate system?
This is what I have for my code so far:
numprocs = 20;
textFilename = cell(1,numprocs);
id = cell(1,numprocs);
tN = 80002;
N = 120;
N2 = N/numprocs + 2;
S= N2 - 2;
A=zeros(numprocs,tN,N/numprocs);
formatSpec = '%f';
for k = 1
textFileName = fullfile('C:\Users\Timmmmeh\Desktop\Project Data',['Processor' num2str(k) '.txt']);
fid = fopen(textFileName, 'r');
q = fid;
m = 0;
w = 0;
for ms = 1:80000
m = m+1;
w = w+1;
textData = textscan(fid,formatSpec, S);
if (isempty(textData{1,1})~= 1)
for j = 1:S
A(k,m,j) = textData{1,1}(j,1);
end
end
end
fclose(fid);
end
dx = 6.35/120;
dy = 5.08/120;
for i = 1:121
xp(i) = dx*(i-1);
yp(i) = dy*(i-1);
end
  2 个评论
Timofey Broslav
Timofey Broslav 2018-5-2
So far I have all my data stored in this matrix: A(k,m,j)
k = file#(1-20),
m - timesteps(80000)
j = (z step size= 6)
I want to combine the k and j because k actually splits the entire z axis (so that I will have 120 concentration points in z axis once i combine them)
Also add x and y concentration dimension.
So essentially I will have this array:
A(80000, 120,120,120)
the last 3 indexes are the z,y,x respectively. Where it will just be the concentration values at each point.
Will this 4-D array work with "pcolor l surf"? I have never heard of this.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by