how do i plot a graph in xy?
    조회 수: 52 (최근 30일)
  
       이전 댓글 표시
    
how do i plot a graph for y = x3? what should i do?
댓글 수: 0
답변 (2개)
  Chad Greene
      
      
 2014년 11월 5일
        If you mean y equals x cubed,
1. define an x array:
x = 1:100;
2. calculate y
y = x.^3;
3. plot
plot(x,y)
댓글 수: 0
  James Tursa
      
      
 2014년 11월 5일
        Do you mean y = x^3? If so, first pick a range for x, then calculate y, then plot it. E.g.,
x = 0:0.1:3; % From 0 to 3 in increments of 0.1
y = x.^3; % Element-wise power uses .^ 
plot(x,y)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


