-->t=0:2:8 t = 0. 2. 4. 6. 8. -->t' ans = 0. 2. 4. 6. 8. -->t*t !--error 10 inconsistent multiplication -->t*t' ans = 120. -->t'*t ans = 0. 0. 0. 0. 0. 0. 4. 8. 12. 16. 0. 8. 16. 24. 32. 0. 12. 24. 36. 48. 0. 16. 32. 48. 64. -->t=0:2:10 t = 0. 2. 4. 6. 8. 10. -->t*t !--error 10 inconsistent multiplication -->t*t' ans = 220. -->t=0:2:8 t = 0. 2. 4. 6. 8. -->t.*t ans = 0. 4. 16. 36. 64. -->t.*t; -->0:1:100' ans = column 1 to 12 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. column 13 to 23 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. column 24 to 34 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. column 35 to 45 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. column 46 to 56 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. column 57 to 67 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. column 68 to 78 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. column 79 to 89 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. column 90 to 100 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. column 101 100. -->0:1:100'; -->0:1:100 ans = column 1 to 12 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. column 13 to 23 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. column 24 to 34 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. column 35 to 45 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. column 46 to 56 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. column 57 to 67 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. -->a=0:1:100 a = column 1 to 12 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. column 13 to 23 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. column 24 to 34 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. column 35 to 45 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. column 46 to 56 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. column 57 to 67 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. -->a a = column 1 to 12 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. column 13 to 23 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. column 24 to 34 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. column 35 to 45 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. column 46 to 56 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. column 57 to 67 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. -->a' ans = 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. -->lines(0) -->a' ans = 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. -->a=[1, 2, 3;4, 5, 6;7,8] !--error 6 inconsistent row/column dimensions -->a=[1, 2, 3;4, 5, 6;7,8 9] a = 1. 2. 3. 4. 5. 6. 7. 8. 9. -->a(3,2) ans = 8. -->a(3,2)=5 a = 1. 2. 3. 4. 5. 6. 7. 5. 9. -->a(3,2)=8 a = 1. 2. 3. 4. 5. 6. 7. 8. 9. -->b=[1 2 3] b = 1. 2. 3. -->w=[b;4 5 6] w = 1. 2. 3. 4. 5. 6. -->w=[a, [1;2;3]] w = 1. 2. 3. 1. 4. 5. 6. 2. 7. 8. 9. 3. -->a(2:) !--error 2 invalid factor -->a(2,:) ans = 4. 5. 6. -->a(:,2) ans = 2. 5. 8. -->t t = 0. 2. 4. 6. 8. -->t2=t.*t t2 = 0. 4. 16. 36. 64. -->plot(t,t2); -->plot(t,t2,"ro-"); -->xtitle("my plot","y","x") -->xtitle("my plot","x","y") -->plot(t,t2+1,"gx-"); -->clf() -->plot(t,t2+1,"gx-"); -->xtitle("my plot","x","y") -->help(); // add afterward // the system we are trying to solve is // x' = -y // y' = x // x(0) = 1 // y(0) = 0 // rewrite as a vector equation in w // [ x' ] [ -y ] [ - w(2,1) ] // [ ] = [ ] This is wdot = [ ] // [ y' ] = [ x ] [ w(1,1) ] // // [ 1 ] // w(0) = [ ] // [ 0 ] // // rewriting in terms of y instead of w // -->function ydot=f(t,y) -->ydot=[-y(2,1);y(1,1)]; -->endfunction -->f(0,[1;0]) ans = 0. 1. -->t=0:0.5:2*%pi; -->t t = column 1 to 12 0. 0.5 1. 1.5 2. 2.5 3. 3.5 4. 4.5 5. 5.5 column 13 6. -->y=ode([1;0],0,t,f); -->w=[t;y]; -->w' ans = 0. 1. 0. 0.5 0.8775826 0.4794255 1. 0.5403023 0.8414710 1.5 0.0707372 0.9974950 2. - 0.4161468 0.9092974 2.5 - 0.8011436 0.5984722 3. - 0.9899925 0.1411201 3.5 - 0.9364567 - 0.3507832 4. - 0.6536437 - 0.7568025 4.5 - 0.2107958 - 0.9775300 5. 0.2836621 - 0.9589242 5.5 0.7086697 - 0.7055403 6. 0.9601700 - 0.2794155 -->clf() -->plot(y(1,:),y(2,:),"bo-") -->xs2eps('b1.eps') !--error 4 undefined variable : filename at line 40 of function xs2eps called by : xs2eps('b1.eps') -->xs2eps("b1.eps") !--error 4 undefined variable : filename at line 40 of function xs2eps called by : xs2eps("b1.eps") -->xs2eps(0,"b1.eps") -->plot(t,y(1,:),"rx-",t,y(2,:),"gx-") -->clf() -->plot(t,y(1,:),"rx-",t,y(2,:),"gx-") -->diary(0)