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 Center および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by