The code doesn't generate a graph. Please tell where I am doing wrong.

1 visualización (últimos 30 días)
MUDASIR MALIK
MUDASIR MALIK el 4 de Abr. de 2022
Comentada: KSSV el 5 de Abr. de 2022
clc, clear, close all
x = 1;
for n = 1:30
y = (7259/14520)*x + 167/2420
plot(n,y,'color','m')
hold on
x = y;
end

Respuestas (1)

KSSV
KSSV el 4 de Abr. de 2022
You have to use a marker, as you are plotting point by point.
x = 1;
for n = 1:30
y = (7259/14520)*x + 167/2420
plot(n,y,'.','color','m')
hold on
x = y;
end
y = 0.5689
y = 0.3534
y = 0.2457
y = 0.1918
y = 0.1649
y = 0.1515
y = 0.1447
y = 0.1414
y = 0.1397
y = 0.1388
y = 0.1384
y = 0.1382
y = 0.1381
y = 0.1381
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
y = 0.1380
  3 comentarios
KSSV
KSSV el 5 de Abr. de 2022
Thanks is accepting/ voting the answer.

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D 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