Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB duplication error

  1. Nov 14, 2013 #1
    Hi, i'm totally new to matlab and tried this for loop

    Code (Text):
    for K = 1:10
      disp(abs(tan(K)))
    end
    it displays
    Code (Text):

    1.5574
     2.1850
     0.14255
     1.1578
     3.3805
     0.29101
     0.87145
     6.7997
     0.45232
     0.64836

     1.5574
     2.1850
     0.14255
     1.1578
     3.3805
     0.29101
     0.87145
     6.7997
     0.45232
     0.64836
    Why did it display this twice?
    Thanks for any help.
     
  2. jcsd
  3. Nov 16, 2013 #2

    kreil

    User Avatar
    Gold Member

    The shortest answer is that it only displayed it once for me when I ran the same code in R2012a.
     
  4. Nov 16, 2013 #3
    Thanks, When I did it again it worked without changing anything but it happened again and duplicated a graph.
     
  5. Nov 21, 2013 #4

    kreil

    User Avatar
    Gold Member

    If you don't show me anything to go with, I can only assume you sneezed while hitting enter, or that you were drunk and seeing double.
     
  6. Nov 22, 2013 #5
    lol, the button only allows you to press it once before changing to a animated non-clickable gear.
     
  7. Nov 22, 2013 #6
    try "clc" before the script
     
  8. Nov 22, 2013 #7
    whats that do?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: MATLAB duplication error
  1. Matlab Error (Replies: 1)

  2. Error code in Matlab (Replies: 3)

Loading...