Undefined function 'ShortLine' for input arguments of type 'double'.
Show older comments
%***- - - - - Main Program
function test()
TransmissionLineData;
[ZSeries,YShunt] = ShortLine(nphc,ngw,nb,bsep,resis,rdext,gmr,x,y,f, sigmag,vbase,sbase)
[Z012,Y012] = SequenceImpedance(ZSeries,YShunt);
%End main Program
function [Z012,Y012] = SequenceImpedance(ZSeries,YShunt)
TS(1,1) = 1;
TS(1,2) = 1;
TS(1,3) = 1;
TS(2,1) = 1;
TS(2,2) = -0.5-sqrt(3)*0.5*i;
TS(2,3) = -0.5+sqrt(3)*0.5*i;
TS(3,1) = 1;
TS(3,2) = -0.5+sqrt(3)*0.5*i;
TS(3,3) = -0.5-sqrt(3)*0.5*i;
ST = inv(TS);
Z012 = ST*ZSeries*TS;
Y012 = ST*YShunt*TS;
12 Comments
Geoff Hayes
on 15 Dec 2017
Mohd - is ShortLine a function that you have written or have downloaded from somewhere? The error suggests that MATLAB can't find that function or you are not providing the correct input parameters.
In the command window type
which ShortLine
The above will return the full path for the function if it can be found. If it can't be found, then try adding it (or rather the folder that it is in) to your MATLAB search path. See https://www.mathworks.com/help/matlab/matlab_env/what-is-the-matlab-search-path.html for details.
MOHD ABDUL MUQEEM
on 15 Dec 2017
Adam
on 15 Dec 2017
So have you define dthe function and added it to your path?
Adam
on 15 Dec 2017
Please format your code, it is almost impossible to work out what is on each line and what is in a comment.
MOHD ABDUL MUQEEM
on 15 Dec 2017
MOHD ABDUL MUQEEM
on 15 Dec 2017
MOHD ABDUL MUQEEM
on 15 Dec 2017
Edited: Walter Roberson
on 15 Dec 2017
MOHD ABDUL MUQEEM
on 15 Dec 2017
Edited: Walter Roberson
on 15 Dec 2017
MOHD ABDUL MUQEEM
on 15 Dec 2017
Edited: Walter Roberson
on 15 Dec 2017
MOHD ABDUL MUQEEM
on 15 Dec 2017
Edited: Walter Roberson
on 15 Dec 2017
MOHD ABDUL MUQEEM
on 15 Dec 2017
Edited: Walter Roberson
on 15 Dec 2017
Walter Roberson
on 15 Dec 2017
I am confused. You have posted several different function test(), only one of which defines function ShortLine . I do not know which one is the correct version.
If you define a function inside a .m but not as the first function in the file, then that second function cannot be called from outside the .m (unless you pass out a handle to it.)
Answers (0)
Categories
Find more on Spreadsheets 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!