Help with matlab code to plot slope field
22 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Guillaume
2017-6-14
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!