Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 5773

Matlab function

$
0
0

I have a couple of question;

1-Is it necessary that the input arguments of MATLAB function should be equal in size? and also output argument when using Livelink Matlab

In this case, the sizes of the arguments are ;

c = 100

cavg=1

MI =1

.................................................................

function MI = MixingIndex(c,cavg)

sumc=0;

for n=1: length(c)

a=(((c(n)-cavg/cavg)^2));

sumc=sumc+a;

end

MI=(1-sqrt((1/length(c))sumc))100;

...................................................................

2- How can I use this external function as a stop condition?

for example;

MixingIndex(c,aeop1(c))<0.5

aeop1(c) is the surface average on a boundry .

what is your suggestion to seek these goals?**


Viewing all articles
Browse latest Browse all 5773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>