Using created functions to set up graph

조회 수: 1 (최근 30일)
Joseph
Joseph 2014년 4월 10일
댓글: Joseph 2014년 4월 10일
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
Joseph
Joseph 2014년 4월 10일
I believe the first part is correct. I cant get started on the second function. Thank you

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by