필터 지우기
필터 지우기

Info

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

How can i run the loop of the function with many other sub functions

조회 수: 2 (최근 30일)
zahid
zahid 2015년 8월 21일
마감: MATLAB Answer Bot 2021년 8월 20일
I am very new in MATLAB and cannot understand that how can i set my function in a loop. Appreciate if anyone can help me.
khan.m # suppose function name
Inputs of the function are the following
Y1=zahid(a); # zahid.m is a sub function with input argument “a” in main function khan.m.
Y2=shahid(b);# shahid.m is a sub function with input argument “b” in main function khan.m.
Y3=data1(:,3);# third column of the function data.m as a input argument (suppose size of this vector is 122 by 1).
Output of the function is following
R # a vector of measurements of size 122 by 1.
Now i want to check the some condition over the vector R and if that condition is true then want to update the vector Y3 only ,having the other inputs same. For example
if max(R)>3 # suppose the condition which i have to check.
j = find(R==max(R), 1); # find the index of maximum value of vector R.
Y3-Y3(j), update the vector Y3 such that delete measurement “j” from vector Y3.
else
stop # if above condition is not true stop the looping of the function khan.m
Note: I do not understand that how can i repeat khan.m if the above condition suppose remain true up to 5 times and i will continue update the vector Y3 i.e after five runs there will be 117 observation in Y3.

답변 (0개)

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by