Undefined function error using initial command

조회 수: 3 (최근 30일)
sauerbrei35
sauerbrei35 2015년 2월 3일
답변: Image Analyst 2015년 2월 3일
Every time I use the "initial" command on MATLAB (which I am required to use by my professor) I keep getting an error: Undefined function 'initial' for input arguments of type 'double'. What is causing this? From collaboration with other class mates I don't seem to have an error in my code.
clear all; close all; clc;
t=0:0.01:20;
A=[0 1 0 0;-2 -1 1 0; 0 0 0 1; 1 0 -1 -1];
B=[0 0 0 0]';
C=[0 1 0 0; 0 0 1 0];
D=[0;0];
q0 = [ 0 0 1 0];
[y,x,t]=initial(A,B,C,D,q0,t);
Y1= [1 0]*y';
Y2= [0 1]*y';
figure ( 1 )
plot ( t, Y1, 'k-', 'LineWidth', 2 )
set ( gca, 'FontSize', 16, 'FontName', 'Times New Roman' )
xlabel ( 'Time (s)' )
ylabel ( 'V_1(t) (m/s)' )
figure ( 2 )
plot ( t, Y2, 'k-', 'LineWidth', 2 )
set ( gca, 'FontSize', 16, 'FontName', 'Times New Roman' )
xlabel ( 'Time (s)' )
ylabel ( 'X_2(t)' )

답변 (1개)

Image Analyst
Image Analyst 2015년 2월 3일
It's not finding the "initial.m" file on your search path. Get your professor's "initial.m" file and put it into the folder where your m-file is living.

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by