Nayoung,
It looks like there are 3 issues here:
1. Plotting two surfaces on the same axes
You are explicitly asking for a second set of axes with
Remove that line, add
and fix the reference to ax(2):
set(ax(1), 'XAxisLocation','top',...
'YAxisLocation','right',...
'Color','none');
Hold on prevents plot functions from removing existing graphics from an axes. You should probably be using it inside your for-loops.
2. Using two colorbars on the same axes
Two colorbars is not supported. You may be able to define individual color maps for your surfaces to help you differentiate them.
3. Finding a cross-section of two surfaces
To find a cross-section or intersection you would need to do some additional math (solve for the thing you want to see) and then plot that data. I am not aware of any 'cross section viewing' tools built in to Matlab's plotting engine.
I lied, I thought of a 4th thing:
4. isosurface in a loop?
This may be what you are intending to do, as I do not understand what your data/variables are modeling and what you are trying to visualize. Realize that you are plotting a surface for each value of both isovalues1 and isovalues2, which means 16 surfaces total, not the two you described in the question title.
Best Answer