Matlab graphing/plotting problem

  • MATLAB
  • Thread starter sara_87
  • Start date
  • Tags
    Matlab
In summary, Matlab graphing/plotting problem refers to difficulties in creating visual representations of data using the Matlab software. Common mistakes include using incorrect syntax and not adjusting the appearance of the graph properly. To customize the appearance of a graph in Matlab, you can change colors, lines, and add annotations or legends. Possible reasons for a graph not showing up in Matlab include incorrect data or syntax, and errors can be troubleshooted by reviewing code, using debugging features, or seeking help from documentation or online resources.
  • #1
sara_87
763
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
  • #2
plot([4 8], [-4 0])
plot([-8 -4], [0 4])

remember to hold graphs if you are entering commands individually.
 
  • #3
thank you!
 

What is Matlab graphing/plotting problem?

Matlab graphing/plotting problem refers to the difficulty or challenges encountered when creating visual representations of data using the Matlab software. It involves understanding the various plotting functions, adjusting the appearance of the graph, and troubleshooting any errors that may arise.

What are the common mistakes when graphing/plotting in Matlab?

Some common mistakes when graphing/plotting in Matlab include using incorrect syntax, not specifying the correct data for the graph, and not adjusting the axes or labels properly. It is also important to check for any missing or incorrect data points, as well as choosing the appropriate graph type for the data being represented.

How can I customize the appearance of my graph in Matlab?

Matlab offers various customization options for graph appearance, such as changing the color, line style, and marker of the plotted data. You can also adjust the axes limits, labels, and title, as well as add annotations and legends to your graph.

Why is my graph not showing up in Matlab?

There could be several reasons why your graph is not showing up in Matlab. Some possible causes include not specifying the correct data, using incorrect plotting syntax, or not displaying the graph after creating it. It is also important to check for any errors or warnings that may have occurred during the plotting process.

How can I troubleshoot errors when graphing/plotting in Matlab?

To troubleshoot errors when graphing/plotting in Matlab, you can start by carefully reviewing your code and checking for any typos or syntax errors. You can also use the "debugging" feature in Matlab to step through your code and identify where the error is occurring. Additionally, checking the Matlab documentation or seeking help from online forums or tutorials can also be helpful in troubleshooting errors.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
932
  • MATLAB, Maple, Mathematica, LaTeX
Replies
32
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
827
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
Back
Top