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

3 Ansichten (letzte 30 Tage)
Ghazi
Ghazi am 11 Jun. 2024
Kommentiert: Ghazi am 12 Jun. 2024

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 11 Jun. 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)

Weitere Antworten (0)

Tags

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by