Hi all, I am not very advance in matlab so forgive me if I mix up the terms. I understand the basics of how to use the fill function fill(X,Y,C). From matlab documentation, it can also be used for multiple fills say fill(X1,Y1,C1,X2,Y2,C2,…).
I have a vector
X = [1 2 2 2 4 4 5 5 3 3 3 1 1 1]
and
Y = [0 1 1 0 0]Nz = linspace(0,1,length(X))dz = max(Nz)/length(X)
I want to write a for loop to create a multiple fill for each identical successive element with different colors for example
x1 = [0 dz*count dz*count 0 0]Y = [0 1 1 0 0]x2 = [dz*count dz*count2 dz*count2 dz*count dz*count]...Y = [0 1 1 0 0]C1,C2...fill(x1,Y,C1,x2,Y,C2...).
"count" here determines the number of times successive elements occur in the vector. "dz" is the step size. I would be glad if anyone here can assist. Thank you.
Best Answer