Plotting a Matrix on a Graph

concAtTimes = [times' c'];
plot(concAtTimes(:,1),concAtTimes(:,2))
xlabel('Time (h)')
ylabel('Drug concentration (kg m^-^3)')
title('Drug concentration in a patient''s blood against time')
concAt10h = concAtTimes(101,2);
disp(['The concentration at 10 h will be ' num2str(concAt10h) ' kg m^-3.'])
So my professor has given me this code here, it all seems to work, however there are some things I do not understand, and are not in the lecture notes (note the times is the dependent variable, and c the dependent).
So to start with you have a matrix with two columns as they have both been inverted, however when plotting what does the (:,1) refer to? The first column? and (:,2)?
Thanks in advance!

回答 (1 件)

Edward
Edward 2012 年 3 月 20 日

0 投票

Found the answer, sorry! Being a noob!

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

製品

タグ

質問済み:

2012 年 3 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by