How to convert Contour subscripts to indices
Mostra commenti meno recenti
Hello,
I am trying to get the linear indices of subscripts that are derived from a contour plot.
I am first making the contour using:
[membranePoints1] = contour(1:matSize(2), 1:matSize(1), membranePotentialFunction1, [0 0 0], 'k');
Giving a plot that looks like this:

Then using a script from file exchange to extract out the x, y coordinates I get an array of 2Xnumber of rows :
[xc,yc] = C2xyz(membranePoints1);
I then am trying to convert these coordinates to a linear index for following computations using the function:
schemeData1.indexValues1 = sub2ind([matSize(2) matSize(1)], xc{1}, yc{1});
But if I convert these indicies back to xy values using
[ivR1, ivR2] = ind2sub(matSize, schemeData1.indexValues1);
My plot looks like this:

Is there any advice as to what may be happening?
Thank you
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Contour Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!