I cannot figure out how to get my data to plot on a simple line graph.

1 view (last 30 days)
close all
close all
clc
hold off
finfo=ncinfo('Pop Up.cvs')
plot('Year','Num_corals')
xlabel('Year')
ylabel('Num_Corals')
  3 Comments
Elizabeth Gleneck
Elizabeth Gleneck on 2 Dec 2021
I'm trying to make a graph of the number of population on the x and the year on the y axis. I really apperiacte the help. Thank you

Sign in to comment.

Answers (1)

Chunru
Chunru on 2 Dec 2021
data = readmatrix('Copy of Pop Up.csv');
x = data(:, 1);
y = data(:, 3);
plot(x, y);
% plot('Year','Num_corals') % This is not correct; doc plot
xlabel('Year')
ylabel('Num_Corals')

Categories

Find more on Line Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!