How to plot this function?
3 views (last 30 days)
I have this function that allows me to work out what the temperature is according to CO2. However, I wanted to know how could I plot temperature as a function of CO2 concentrations.
This is the function that tells me how to get from a certain CO2 value to a Temperature value for that CO2 however I'd like to plot it as a graph.
s0=1367.6; %constant parameter
B=142.6046; %another constant
eps=A/(B-carbon);%green house value as a function of CO2 concentration
sigma=5.67*(10^(-8)); % constant parameter
temperature = t^(1/4)
Ingrid on 12 Dec 2014
just create a vector of relevant CO2 concentrations and call your temperature funciton for each value
carbon = 1:10:1000; % place here your relevant concentrations that you want to plot
temperatureY = zeros(length(carbon),1);
for ii = 1:length(carbon)
temperatureY(ii) = temperature(carbon(ii));
you need the for loop here because your function cannot deal with vectors so if speed of your code is an issue this is something you can still improve