Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

matrix element is not controlled through function

조회 수: 2 (최근 30일)
Hun Mo
Hun Mo 2012년 12월 17일
마감: MATLAB Answer Bot 2021년 8월 20일
In the following situation, I expected jv to have 10 elements of same value. Result is that jv are all zero except jv(10). How can I solve this problem?
for nk=1:10
[j,jv,u]=Tflux(...,nk)
end
function [j,jv,u]=Tflux(...,nk)
jv(nk)=sa.*lp + si
end

답변 (1개)

Titus Edelhofer
Titus Edelhofer 2012년 12월 17일
Hi,
hmm, the interesting part is in the "...": do you pass jv into Tflux? I.e., do you have
for nk=1:10
[j,jv,u] = Tflux(jv, ..., nk);
end
function [j,v,u] = Tflux(jv, ..., nk)
jv(nk) = sa.*lp+si;
end
If yes it should work ...
Titus
  댓글 수: 2
Hun Mo
Hun Mo 2012년 12월 17일
no jv in the input arguement. the inclusion is unnecessary but if included will it work without causing any troble? (i will try)
Hun Mo
Hun Mo 2012년 12월 17일
id did not work.

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by