How to plot a continuous zero plot in Matlab?

Click For Summary
SUMMARY

The discussion focuses on creating a continuous zero plot in MATLAB. Users suggest defining a vector of zeros with the same size as the x-axis vector to ensure continuity. The recommended approach is to use the command y1 = zeros([1 500]); and plot(x, zeros(size(x)) to achieve the desired effect. This method guarantees that the zero plot aligns correctly with the specified x values.

PREREQUISITES
  • Familiarity with MATLAB syntax and commands
  • Understanding of vector operations in MATLAB
  • Basic knowledge of plotting functions in MATLAB
  • Experience with defining and manipulating arrays
NEXT STEPS
  • Research MATLAB's zeros function for creating zero matrices
  • Learn about MATLAB's plot function and its parameters
  • Explore MATLAB's array manipulation techniques
  • Investigate advanced plotting options in MATLAB for better visualization
USEFUL FOR

MATLAB users, data analysts, and engineers looking to enhance their plotting skills and create accurate visual representations of data.

hokhani
Messages
601
Reaction score
22
In the plot command below
Code:
x=1:5:100
plot(x,y,x,0)

one plot is noncontinuous zero plot. How can I plot a continuous zero one?
 
Physics news on Phys.org
Try
Code:
x = 1:5:100;
plot(x, zeros(size(x));

(Same thing as Dr Transport suggested, except it makes sure the vector of zeros has the same size as x.)
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K