2013-03-31 49 views
0

我有一些matlab代码是为绘图中的多行绘制而创建的。但是,似乎并没有像我希望的那样在文字的末尾画出文字。有没有人有一种更简单的方法,为什么它可能不工作。在matlab中绘制多行文字行尾文字

format long; 
options = optimset('TolFun',1e-12); 
vfb = -0.9; 
fT= 0.026; 
fF = 0.4591431; 
gamma = 0.2377589; 
datafile = fopen('quiz3p2bresults.text','w'); 
if datafile == -1 
    error('Error opening data file!'); 
end 


fprintf(datafile, '%s\t %s\n', 'Vgb', 'PSIL') 
vgb = 1:0.5:2; 
vgb = vgb'; 
vdb = 0:0.1:1.5; 
vdb = repmat(vdb,3,1); 
eqn = @(psiL) (vgb-vfb-gamma*(sqrt((psiL-vdb)/fT))); 
result = fsolve(eqn,vgb,options); 
plot(vdb,result(1,:),'r',vdb,result(2,:),'y',vdb,result(3,:),'g'); 
text(max(vdb), max(result), num2str(vgb)); 


fclose(datafile); 

回答

0

尝试

text(max(vdb), result(: , max(size(result))), num2str(vgb)); 

你也可能要更改剧情

plot(vdb(1,:),result(1,:), ...