I'm struggling with an issue that is part of an assignment.
What i'm trying to do is store different plot-handles and store them in a vector.
Then i should be able to retrieve that handle and change the attributes of the different plots (widht, color, etc).
I've tried this:
% createPlot.m
& taken handle of a vector as in parameter
function out = createPlot(plot_Handles)
x = linspace(0,3*pi,50);
whichGraph = input('Give graph id: ');
disp(['Graph: ', num2str(whichGraph)]);
theFunction = input('Give function: ', 's');
y = eval(theFunction);
disp(['Function: ', theFunction]);
h = plot(x, y);
%get(h); This works just fine to get the properties
plot(x, y);
plot_Handles(whichGraf) = h; % store the handle in the vector
get(plot_Handles(whichGraf)); % THIS DOES NOT WORK?? WHY??
out = plot_Handles;
As you can see, the problem is when i try to retrieve the handle from the vector.
I can't figure out what i do wrong :S
Appreciate any help i can get.
Best Regards
Den0nde

New Topic/Question
Reply



MultiQuote



|