Help with matlab code to plot slope field

21 visualizzazioni (ultimi 30 giorni)
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 )

Risposta accettata

Guillaume
Guillaume il 14 Giu 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.

Più risposte (0)

Categorie

Scopri di più su Creating, Deleting, and Querying Graphics Objects in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by