Filter löschen
Filter löschen

how can i input variable in function?

1 Ansicht (letzte 30 Tage)
arian hoseini
arian hoseini am 5 Jan. 2022
Bearbeitet: Walter Roberson am 5 Jan. 2022
linedata = [ 1 0 0.000 0.200
2 0 0.000 0.150
3 0 0.000 0.250
1 4 0.035 0.225
1 5 0.025 0.105
1 6 0.040 0.215
2 4 0.000 0.035
3 5 0.000 0.042
4 6 0.028 0.125
5 6 0.026 0.175];
function [Zbus] = zbuild(linedata)
nl = linedata(:,1); nr = linedata(:,2); R = linedata(:,3);
X = linedata(:,4);

Akzeptierte Antwort

Voss
Voss am 5 Jan. 2022
% define your input argument:
linedata = [ 1 0 0.000 0.200
2 0 0.000 0.150
3 0 0.000 0.250
1 4 0.035 0.225
1 5 0.025 0.105
1 6 0.040 0.215
2 4 0.000 0.035
3 5 0.000 0.042
4 6 0.028 0.125
5 6 0.026 0.175];
% call the function with the input argument:
zbuild(linedata)
ans = 0
function [Zbus] = zbuild(linedata)
nl = linedata(:,1); nr = linedata(:,2); R = linedata(:,3);
X = linedata(:,4);
Zbus = 0; % define the output argument to return
end

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by