필터 지우기
필터 지우기

Info

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

how can i set for statement into connected two files

조회 수: 1 (최근 30일)
muhammad ismat
muhammad ismat 2017년 2월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
if i have two function in (separated files), first function contain two for statement as
{ for p= 1: 100}
{ for r =1: 100}
and second function contain
{for i = 1: 100} when i run above program i take the result of first function and use it in second function. i want to take initial value of "p" and initial value of "r" and run second function 100 times then initial value of p and second value of r and run second function 100 times and so on. in this case what should i do?

답변 (1개)

KSSV
KSSV 2017년 2월 16일
N = 3 ; %100
for p = 1:N
for q = 1:N
[p,q]
%%call your first function
for r = 1:N
[p,q,r]
% use p,q in second function
end
end
end
Note that the above can be vectorised depending on what your functions are.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by