<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
/* Quote Levels Colors */
blockquote.cite { color: navy !important; background-color: RGB(245,245,245) !important;
}
blockquote.cite blockquote.cite { color: maroon !important; background-color: RGB(235,235,235) !important;
}
blockquote.cite blockquote.cite blockquote.cite { color: green !important; background-color: RGB(225,225,225) !important;
}
blockquote.cite blockquote.cite blockquote.cite blockquote.cite { color: purple !important; background-color: RGB(215,215,215) !important;
}
blockquote.cite blockquote.cite blockquote.cite blockquote.cite blockquote.cite { color: teal !important; background-color: RGB(205,205,205) !important;
}
</style>
</head>
<body>
try <br>
<br>
<tt>index=1:size(log_data,'r')-1;</tt><tt><br>
</tt><tt>energy=(log_data(index+1,1)-log_data(index,1)).*log_data(index,2).*log_data(index,3);</tt><br>
<br>
Best wishes, <br>
<br>
Jasper.<br>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 8/1/2017 13:00, Richard llom wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1501585231691-4036792.post@n3.nabble.com"
id="mid_1501585231691_4036792_post_n3_nabble_com" class=" cite">
<pre wrap="">Hello All,
I have this for loop:
for i=1:size(log_data,'r')-1
energy(i)=(log_data(i+1,1)-log_data(i,1))*log_data(i,2)*log_data(i,3);
end
The rows / loopsize are only a couple of thousands, so it is not that big of
deal, still I was wondering: It is possible to do this w/o a loop?
cheers
--
View this message in context: <a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/Can-this-loop-be-avoided-tp4036792.html">http://mailinglists.scilab.org/Can-this-loop-be-avoided-tp4036792.html</a>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>