Correct plot in matlab
    4 次查看(过去 30 天)
  
       显示 更早的评论
    
Hi,
I stored some data in two column matrix, named "Shear", the results are correct. But how to plot this data in a correct way? I want the left column data on the x-axis (0m...26.6m) corresponding with the second column data on the Y-axis.
The command "plot(Shear)" gives not the correct result at all.
Thanks in advance
syms Z
X=0
while X<=0.5
    Shear =[X,(q)/(2*h)*int((((sin(omega))^2+(h^2)*(Z^2+Y^2-2*Z*Y*cos(omega)))^(1/2)),Z,26.6,26.6-X)];
    disp(Shear);
    X =  X+0.1;
end
plot(Shear)
0 个评论
回答(2 个)
  José-Luis
      
 2012-10-21
        Try:
   plot(Shear(:,1),Shear(:,2));
If you give a matrix as an argument to plot() it will draw each column as independent data.
Read the documentation for more details:
   doc plot;
0 个评论
  Azzi Abdelmalek
      
      
 2012-10-21
        
      编辑:Azzi Abdelmalek
      
      
 2012-10-21
  
      You should use Shear=[Shear,... instead of Shear=[X,..
 Shear=0;X=0;
 while X<=0.5
 Shear =[Shear,(q)/(2*h)*int((((sin(omega))^2+(h^2)*(Z^2+Y^2-2*Z*Y*cos(omega)))^(1/2)),Z,26.6,26.6-X)];
 X=X+0.5
 end
0 个评论
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!