Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: user defined function and graph plotting
Replies: 1   Last Post: Sep 15, 2013 9:41 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Kenneth Potter

Posts: 11
Registered: 2/24/05
user defined function and graph plotting
Posted: Sep 14, 2013 1:06 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear Colleagues,

Is it possible to write a simple function that takes some arguments and plots a graph? As I have written a simple function to automatically plot graphs for me but they wont generate when I call the function.

Simple example

function = plot_graphs(x, y, n)

% Some data manipulation here - excluded for simplicity %

figure(n)

plot(x, y)
title(' Figure n')

When I run this function it wont plot my graph. If I return arguments and call the plot in the original script that is plotting the function then it works. But I don't want to generate code by hand for 50 plots, I wish to call a function each time to make the scripting compact.

Is this possible?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.