Several statements in if condition plotting and drawing arrow
2 views (last 30 days)
My code is like this:
if nt==1 | nt==101 | nt==1001
baseLine = 0; %# Baseline value for filling under the curves
index = 1:101; %# Indices of points to fill under
plot(xx,body_up,'k','Linewidth',1.5); %# Plot the first line
hold on; %# Add to the plot
h1 = fill(xx(index([1 1:end end])),... %# Plot the first filled polygon
[baseLine body_up(index) baseLine],...
plot(xx,body_down,'k','Linewidth',1.5); %# Plot the second line
h2 = fill(xx(index([1 1:end end])),... %# Plot the second filled polygon
[baseLine body_down(index) baseLine], 'w','EdgeColor','none');
plot(xx(index),baseLine.*ones(size(index)),'r'); %#Plot the red line
The question >>
I want to show an arrow for each u and p in each time in the figure using latex. But when I use this code it shows just last nt value in if condition (1001) in the title.
Any help, please!
dpb on 29 Dec 2015
"...But when I use this code it shows just last nt value in if condition (1001) in the title."
Surely. Because (quoting from documentation) " title sets the Title property of the current axes graphics object to a new text graphics object."
Since there's only one Title property, you overwrite displayed title each pass thru. Not sure what you want as an end result, but that's the cause of the symptom. Perhaps you intend to create multiple figure 's instead of only one by the repeated use of the fixed integer handle '3'; I don't know???