Changing X and Y axis limits??
Afficher commentaires plus anciens
CODE:
function x = logmap(R, timesteps, xinit, color)
clc
x = zeros(timesteps,1);
x(1) = xinit;
for t = 1:length(x)-1
x(t+1) = R*x(t)*(1-x(t));
end
plot(x, [color,'.-'])
xlabel('time')
ylabel('population')
and query the code with
logmap(3.25,50,0.3,'b')
I get a figure with values 0-50 on the X-axis and 0-1 on the Y-axis. But what I am trying to do is init value of 0.3 on the scale of 100 (i.e) the Y-axis scale should be 0-100 such that the init plot is 0.3 * 100 = 30.
I tried to change the limits using 'Plot tools' which basically changed the whole graph. And also I have tried using 'axis' which does not seem to work here.
I tried both the approaches like I mentioned in my question. Not sure they work the way I want them to. The problem is with mapping init value of 0.3 with Y-axis value 30 on X-axis timestep 1. Thanks.
1 commentaire
Jan
le 28 Jan 2013
I do not understand "init value of 0.3 on the scale of 100 (i.e) the Y-axis scale should be 0-100 such that the init plot is 0.3 * 100 = 30." Please explain this again.
Réponses (1)
Matt J
le 25 Jan 2013
What happens when you do
ylim([0.3 30])
1 commentaire
Pravallika
le 25 Jan 2013
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!