matlab - Issue using Surf, X Y Z and C cannot be complex -
i'm trying add title surface plot, attempting add descriptive text plot results in above error. can plot data fine, attempting add title throws error. i've listed code below , can't figure out why simple text title causes problems. i'd appreciate ideas. thanks!
function lwmmsweepplots(excel,cpb,rpb) data=xlsread(excel); [r,c]=size(data); iterations=round(c./cpb); i=1:iterations; power=data(1:rpb,cpb*(i-1)+1:cpb*(i-1)+cpb); xone=data(rpb*4-3:rpb*4-3+(rpb-1),cpb*(i-1)+1:cpb*(i-1)+cpb); yone=data(rpb*5-2:rpb*5-2+(rpb-1),cpb*(i-1)+1:cpb*(i-1)+cpb); xtwo=data(rpb+2,cpb*(i-1)+1); ytwo=data(rpb*2+3,cpb*(i-1)+1); xtn=num2str(xtwo);ytn=num2str(ytwo); mytitle=strcat('x2,y2 coordinates:',xtn,',',ytn); figure;surf(xone,yone,power,title(mytitle)) end end
that's not how add title. if want add title need use title separately. way doing it, matlab treating output of title cdata of surface.
figure surf(xone, yone, power) title(mytitle)
Comments
Post a Comment