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

4 次查看(过去 30 天)

采纳的回答

Walter Roberson
Walter Roberson 2024-6-11
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)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by