Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

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

1 visualización (últimos 30 días)
zahid
zahid el 21 de Ag. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by