Help with matlab code to plot slope field
21 views (last 30 days)
Show older comments
Orchid Poponne
on 14 Jun 2017
Commented: Orchid Poponne
on 14 Jun 2017
I have this code from one of my math classes, but when I try to run it, I get an error stating "Undefined function or variable 'SlopeField'." What's wrong with the code, I tried e-mailing the writer but no luck. Would be grateful for any help! Thanks!
% We clear all variables which may have been defined
clear
% These variables define the minimum and maximum values
% for "T" in the slope field.
T_min = -10;
T_max = 10;
% These variables define the minimum and maximum values
% for "Y" in the slope field.
Y_min = -10;
Y_max = 10;
% These variables define the spacings between the slope lines
% in the T and Y directions.
T_step = 1;
Y_step = 1;
% This creates a new figure window and plots the slope field
figure
SlopeField( T_min, T_max, T_step, Y_min, Y_max, Y_step )
0 Comments
Accepted Answer
Guillaume
on 14 Jun 2017
Well, you need a file called SlopeField.m somewhere in your matlab path. If you haven't got it, and can't get hold of it, there's nothing you can do short of rewriting it yourself if you know what it's supposed to do.
More Answers (0)
See Also
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!