Borrar filtros
Borrar filtros

Why I can't plot x = years , y = GDP

1 visualización (últimos 30 días)
Ghazi
Ghazi el 11 de Jun. de 2024
Comentada: Ghazi el 12 de Jun. de 2024

Respuesta aceptada

Walter Roberson
Walter Roberson el 11 de Jun. de 2024
GDP.("YEARS")
retrieves the field Years from the GDP object, and displays the result (because you have no semi-colon on the line)
x=("YEARS")
assigns the string "YEARS" to x. This has nothing to do with GDP.("YEARS")
Perhaps you want
x = GDP.("YEARS");
y = GDP.("GDP");
plot(x, y)

Más respuestas (0)

Categorías

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

Etiquetas

Productos


Versión

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by