mardi 15 août 2017

Calling Selective values in if-else statement

I have written a function called "tension.m" in which I have used if else condition as shown below.

 function [T] = tension(v, sigma,G,N,K)
 %the values of sigma,G,N,K can be taken arbitrary.
 u=0:0.01:5;
 w=2.2;
 if u<w
  T =v*sqrt(sigma+G^2/(N-K);
 else
  T=v*sqrt(sigma+G^2/(N+K);
 end

Now in another function "myvalues.m" I need to call those values of "T" where (u>w) i.e. values of "T" after else statement only. Could someone please help me on how to code this in MatLab?

Aucun commentaire:

Enregistrer un commentaire