Borrar filtros
Borrar filtros

How to plot with continuous line

5 visualizaciones (últimos 30 días)
K
K el 24 de Nov. de 2012
Hi, I have an array and I want to plot it into graph. My problem is I got a dotted graph line and not a continuous one. How should I change my code to solve this problem? My code look like this:
Figure(1) hold on
for i= 1:5 array(i) = i*3; plot (i, array(i)); end

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 24 de Nov. de 2012
Editada: Azzi Abdelmalek el 24 de Nov. de 2012
Use plot after the loop
for ii= 1:5
x(ii)=ii
array(ii) = ii*3;
end
plot (x, array);
%don't use i and j as variables (used with comlex numbers)
  5 comentarios
K
K el 24 de Nov. de 2012
One more question. Do you know what is the maximum elements of array that Matlab can support?
Azzi Abdelmalek
Azzi Abdelmalek el 24 de Nov. de 2012
Editada: Azzi Abdelmalek el 24 de Nov. de 2012
I can't tell exactly, that depends on your matlab version, also on your computer power and memory. look at this link http://www.mathworks.com/support/solutions/en/data/1-IHYHFZ/index.html

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by