Error: Attempt to add (variable) to a static workspace,

조회 수: 34 (최근 30일)
B.E.
B.E. 2019년 12월 31일
댓글: B.E. 2019년 12월 31일
My function
function Densite
load x;
load h
if ...........................
.................
elseif ........................
........................
end
end
error
Error using ===> load
Attempt to add "x" to static workspace
Errr in ===> Densite
load x;

채택된 답변

Max Murphy
Max Murphy 2019년 12월 31일
Try
function Densite
% load x;
% load h
in = load('x.mat','x'); % If these were together in one file, like 'data.mat'
x = in.x; % then you could load both at once
in = load('h.mat','h');
h = in.h;
if ...........................
.................
elseif ........................
........................
end
end
error
Error using ===> load
Attempt to add "x" to static workspace
Errr in ===> Densite
load x;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Standard File Formats에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by