Filter löschen
Filter löschen

Using created functions to set up graph

3 Ansichten (letzte 30 Tage)
Joseph
Joseph am 10 Apr. 2014
Kommentiert: Joseph am 10 Apr. 2014
My over all objective is to create 2 functions. the first being to set up plot title and axis labels(below), the second function prompts the user to choose line width, line style, line color for 3 different functions(f1, f2, and f3). This will all be combined on one graph in a script file.
function LabelPlot(TitleText,Xtext,Ytext)
% H1 : adds a title, X and Y axis labels, and gridlines to a graph
% Help Text:
% Input arguments:
% TitleText = a string for the title of the graph
% Xtext = a string for the x axis label
% Ytext = a string for the y axis label
% Output arguments:
% There are no output arguments
title('TitleText');
xlabel('Xtext');
ylabel('Ytext');
end
I'm not sure how to get function 2 set up:
function InteractivePlot(fh, xmin, xmax)
% creates and formats a plot(x,f) using inputss from the command window
% Help Text:
% 1000 values of x between xmin and xmax are used in the plot.
% the feval() function is used to evaluate the function at each value of x.
% the user inputs the line color, line style, and line width for the graph
% from the command window during execution of this function.
% Input Arguments:
% fh = function handle of the function to be plotted
% xmin = minimum x value to plot
% xmax = maximum x value to plot
end
  1 Kommentar
Joseph
Joseph am 10 Apr. 2014
I believe the first part is correct. I cant get started on the second function. Thank you

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by