-------------------> Session (re)starting: 14-Apr-2008 09:32:57
cd today
guide
other
??? Undefined function or variable 'other'.
other1
Data size to use for the examples :
n =
[]
Plot_type to use:
1: Area Plot
2: Bar Chart
3. 3D Bar Chart
4. Staircase Plot
5. Pie Chart : 2
x
x =
3
other1
Data size to use for the examples (default: 10) :
n =
[]
Plot_type to use:
1: Area Plot
2: Bar Chart
3. 3D Bar Chart
4. Staircase Plot
5. Pie Chart : 2
other1
Data size to use for the examples (default: 10) :
value of n to be used: 10
Plot_type to use:
1: Area Plot
2: Bar Chart
3. 3D Bar Chart
4. Staircase Plot
5. Pie Chart : 4
ccc
other1
Data size to use for the examples (default: 10) : 55
value of n to be used: 55
Plot_type to use:
1: Area Plot
2: Bar Chart
3. 3D Bar Chart
4. Staircase Plot
5. Pie Chart : round
??? Error using ==> input
Error using ==> round
Not enough input arguments.
% [A common bug message in Matlab. Means you've used a builtin
% function name as a variable.]
Plot_type to use:
1: Area Plot
2: Bar Chart
3. 3D Bar Chart
4. Staircase Plot
5. Pie Chart : 'circular'
??? Index exceeds matrix dimensions.
Error in ==> other1 at 24
choice = PlotTypeStrings(plot_type);
24 choice = PlotTypeStrings(plot_type);
plot_type
plot_type =
circular
class(plot_type)
ans =
char
dbquit
more on
type other2
n = input('Data size to use for the examples (10 is the default): ');
if isempty(n)
n = 10;
end
prompt = 'Plot_type to use: \n 1: Area Plot\n 2: Bar Chart \n 3. 3D Bar Chart \n 4. Staircase Plot \n 5. Pie Chart : ';
plot_type = input(prompt);
if isempty(plot_type)
plot_type = 3;
end
PlotTypeStrings = strvcat('Area Plot', ...
'Bar Chart', ...
'3D Bar Chart', ...
'Staircase Plot', ...
'Pie Chart');
%-------------------------------------------------------------------
% Don't make the users type in the actual text for the chart
% type. It's too easy for them to make a mistake with capitalization
% or spacing, because switch/case have to have an exact match.
% Using an integer choice is usually better.
%-------------------------------------------------------------------
choice = PlotTypeStrings(plot_type);
switch choice
case(PlotTypeStrings(1))
%--------------
% An area plot
%--------------
z = linspace(-pi,pi,n);;
figure;
area([sin(z); cos(z)]);
title('Using Area Plotting');
unstack
case(PlotTypeStrings(2))
%--------------------
% A simple bar chart
%--------------------
x = linspace(-3, 3, n);
y = exp(-x.*x);
figure;
bar(x, y);
title('Bar Chart')
unstack;
case(PlotTypeStrings(3))
%----------------
% A 3D bar chart
%----------------
x = linspace(-3, 3, n);
y = exp(-x.*x);
figure;
bar3(x, y);
title('3D Bar Chart')
unstack;
case(PlotTypeStrings(4))
%-----------------
% A staircae plot
%-----------------
x = linspace(-3, 3, n);
y = exp(-x.*x);
figure;
stairs(x, y);
title('Staircase Plot')
unstack;
case(PlotTypeStrings(5))
%---------------------------------------------------
% Disassembled pie chart.
% Notice that I used rand, not randn. Try it and
% see what Matlab's pie does with the negative data.
%---------------------------------------------------
x = rand(n,1);
figure;
pie(x, x == max(x)); % This distinguishes the largest slice
title('pie chart');
unstack;
otherwise
%------------------------------------------------------------------------
% A drawnow example. Without the pause or drawnow command, all you see is
% the last plot. I choice m data points so that when Matlab *does* show
% all of the graphs because of a drawnow, they won't zip past too fast
% to see.
%------------------------------------------------------------------------
n = 12;
m = 200000;
close all
figure;
for k = 1:n
plot(randn(m,1));
title(sprintf('Iteration %d', k))
%------------------------------------------------------
% Need to insert either a pause here (e.g., pause(0.5))
% or the "drawnow" command.
%------------------------------------------------------
end
end
more off
ccc
u1
filename =
0
path =
0
u3
??? Error: File: u3.m Line: 5 Column: 9
A MATLAB string constant is not terminated properly.
u3
u2
whos
Name Size Bytes Class Attributes
f 1x12 24 char
filename 1x1 8 double
ind 1x1 8 double
p 1x36 72 char
path 1x1 8 double
f
f =
OtherPlots.m
p
p =
/nfs/mneme/home/users/bramley/today/
ind
ind =
1
ccc
u3
whos
Name Size Bytes Class Attributes
f 1x5 10 char
ind 1x1 8 double
p 1x36 72 char
f
f =
ggg.m
p
p =
/nfs/mneme/home/users/bramley/today/
ind
ind =
1
ccc
u5
close all
-------------------> Session (re)starting: 14-Apr-2008 10:05:20
ls
A_eigenvalues.mat B_eigenvalues.mat SingleEigenvalues attic cases cvt.m debugstuff.m eigenvalue_plot.m ev.m ttt.m
help ginput
GINPUT Graphical input from mouse.
[X,Y] = GINPUT(N) gets N points from the current axes and returns
the X- and Y-coordinates in length N vectors X and Y. The cursor
can be positioned using a mouse (or by using the Arrow Keys on some
systems). Data points are entered by pressing a mouse button
or any key on the keyboard except carriage return, which terminates
the input before N points are entered.
[X,Y] = GINPUT gathers an unlimited number of points until the
return key is pressed.
[X,Y,BUTTON] = GINPUT(N) returns a third result, BUTTON, that
contains a vector of integers specifying which mouse button was
used (1,2,3 from left) or ASCII numbers if a key on the keyboard
was used.
Examples:
[x,y] = ginput;
[x,y] = ginput(5);
[x, y, button] = ginput(1);
See also gtext, uirestore, uisuspend, waitforbuttonpress.
Reference page in Help browser
doc ginput
ccc
guide
uiopen('/nfs/mneme/home/users/bramley/today/eigenvalues/eigenvalue_plot.m', true);
cd ../eigenvalues/
ls
A_eigenvalues.mat B_eigenvalues.mat SingleEigenvalues attic cases cvt.m debugstuff.m eigenvalue_plot.m ev.m ttt.m
uiopen('figure')
-------------------> Session (re)starting: 14-Apr-2008 10:16:19
-------------------> Session (re)starting: 14-Apr-2008 10:16:43
ev
---------- In function eigenvalue_plot -----------------
Max norm among B's eigenvalues is 0.0688537
Min norm among B's eigenvalues is 0.000338727
Max norm among A's eigenvalues is 0.0689104
Min norm among A's eigenvalues is 8.49189e-05
Max norm among A and B's eigenvalues is 0.0689104
Min norm among A and B's eigenvalues is 8.49189e-05
Max log of norms of A's eigenvalues: -2.67495
Min log of norms of A's eigenvalues: -9.37381
Max log of norms of B's eigenvalues: -3.04948
Min log of norms of B's eigenvalues: -7.44384
Max log of norms among A and B's eigenvalues is -2.67495
Min log of norms among A and B's eigenvalues is -9.37381
---------- End output from eigenvalue_plot-----------------
whos
Name Size Bytes Class Attributes
A 2584x2 41344 double
Amax 1x1 8 double
Amin 1x1 8 double
B 2584x2 41344 double
Bmax 1x1 8 double
Bmin 1x1 8 double
GLOBAL_bloviation 1x1 1 logical global
GLOBAL_showlegends 1x1 1 logical global
[x,y] =ginput(2)
x =
0.0031846
-0.035031
y =
0.047062
0.0138
exit