필터 지우기
필터 지우기

how can i input variable in function?

조회 수: 1 (최근 30일)
arian hoseini
arian hoseini 2022년 1월 5일
편집: Walter Roberson 2022년 1월 5일
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);

채택된 답변

Voss
Voss 2022년 1월 5일
% 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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by