Azzera filtri
Azzera filtri

Create a solid line instead of single points in the plot

2 visualizzazioni (ultimi 30 giorni)
My Problem is I calculated curves out of 81 Data points and want to plot it as a solid line. If I plot it, the only way it shows the curve is as points, stars etc. As you can see in the picture below.
I have to do this seven times.
The code for this is:
imax is from 1 to 7 an (each curve)
N is from 1 to 81 and are my data points
The rest is calculated before but not relevant for the problem
FZA2(k,h)=(T2(h,1)*i2(k)*i2E*nges)/rdyn; %in N

Risposte (2)

VBBV il 24 Apr 2024
If the plot function is inside a loop, you could put it outside the loop as shown below, in order to plot solid line
plot(vR(1,:),FZA2(1,:),'b-',vR(2,:),FZA2(2,:),'r-',vR(3,:),FZA2(3,:),'g-', ...
  1 Commento
VBBV il 24 Apr 2024
Modificato: VBBV il 24 Apr 2024
From your code, it shows that you try to plot scalars which need markers ,instead if you plot vectors, you can obtain a solid line without markers. You can also avoid, the repetition inside the plot function, by using a for or a while looop.

Accedi per commentare.

Steven Lord
Steven Lord il 24 Apr 2024
Rather than plotting individual points inside a loop (as @VBBV and I both suspect you are doing) you could pull the plot command out of the loop (as VBBV suggested previously) or you could create an animatedline before the loop and addpoints to it inside the loop.


Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by