Faced with this problem quite some years ago I coded my own solution which used multiple lines for segment of a curve, allowing each line to be a distinct colour. More recently I spotted a very useful trick with this entry “Colored line or scatter plot” on the FEX. surface() will render 2-D lines, as a special case of 3-D, but you must pass into matrix valued data to make it work, so you have to duplicate the vector:

%% Some Data x = linspace(0, 2*pi)'; y = sin(x); plot(x, y); % a basic monochrome plot %% Trick surface into a 2-D plot surface('XData', [x x], ... % N.B. XYZC Data must have at least 2 cols 'YData', [y y], ... 'ZData', zeros(numel(x),2), ... 'CData', [y y], ... 'FaceColor', 'none', ... 'EdgeColor', 'interp', ... 'Marker', 'none');]]>

This is a good question. You would need to make each segment independently. I was actually going to start with that when I saw the question posted but realized this was pre-built. Seems like next week’s topic is now picked!

]]>A=magic(5);% Or the matrix from your first Excel file

hv=(A<20); %All elements that are smaller than 20

B=magic(5)*20 %Or the matrix from your second excel file

B(hv)=0;%Change the values of your second file to 0 for which the condition of the first file is true

Of course at the end you need to write B back to the Excel file :-). ]]>

f=xlsread(‘cbtd.xls’);%/ this file has to be edited later

g=xlsread(‘cbam.xls’);

now i have use two nestd for loops and check a condition that

if g(i)(j)<80 then

f(i)(j)=0

and that excel file named f should be edited

thanks in advance DOUG

Thanks Doug!!

]]>