Matlab graphing/plotting problem

  • Context: MATLAB 
  • Thread starter Thread starter sara_87
  • Start date Start date
  • Tags Tags
    Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
sara_87
Messages
748
Reaction score
0

Homework Statement



i have 4 points,
(8,0)
(4,-4)
(-4,4)
(-8,0)
i want to draw a graph of this on MATLAB so that the first to points are joined, the last two points are joined, but i want it on the same graph.
how do i do this? what's the command?
thank you

Homework Equations





The Attempt at a Solution

 
Physics news on Phys.org
plot([4 8], [-4 0])
plot([-8 -4], [0 4])

remember to hold graphs if you are entering commands individually.