I have my main script with a nested function. p2 is array valued and it is calculated in the main script and nested function as well. To find corresponding p2 array values I use specific time using if condition. My main script is like this:
ii= (1/dx) +1 *
x(i) = (i-1)*dx;
[p2] = p_thick(ii,dx,dt,...
if nt==1001 *
[p2smallregion] = small_time();
And my nested function like this:
function [p2smallregion] = small_time()
dx = 0.001;
for nt = 1:30001;
if nt ==1001;
m(j) = (j-1)*dx;
p2smallregion(j) = t^2*alphabar*m(j);
THE QUESTION IS: As you can see I can plot p2 values from main script and nested function in the same plot in a specific time say=0.1. But How can I plot this in different time values in the same plot? 3D plot with colourbar time range between 0.01 and 0.1 with 11 time values??? Please see attached. I would like to get exactly like attached.