Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 230

Matlab: Abort function call with Strg+C but KEEP return value

$
0
0

I have a function in matlab with something like this:

function [ out ] = myFunc(arg1, arg2)    times = [];    for i = 1:arg1        tic        % do some long calculations        times = [times; toc];    end    % Return    out = times;end

I want to abort the running function now but keep the values of times which are currently already taken. How to do it? When I press STRG+C, I simply loose it because it's only a local function variable which is deleted when the function leaves the scope...Thanks!


Viewing all articles
Browse latest Browse all 230

Trending Articles



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