How do I free up terminal for a script to keep running, i.e. run a script in two places at once?

1 回表示 (過去 30 日間)
I have a camera connected to my computer which, for it to take a video, runs a function that is along the lines of:
function video(camera)
while X
camera.takePicture();
drawnow;
end
end
My main driver script is along the lines of:
camera.video;
%do stuff that changes the images and what the camera sees
I want the camera to be running while the rest of the script is running so I can see what is going on.
Anyone have an easy way of doing this? I don't want to overkill.

採用された回答

Matt Macaulay
Matt Macaulay 2018 年 6 月 28 日
I don't think it's possible to have the script run at two places at once. However a quick workaround would be to move the while loop to the main driver script:
while X
camera.video;
%do stuff that changes the images and what the camera sees
end
and so the video function is now only
function video(camera)
camera.takePicture();
drawnow;
end
  1 件のコメント
Real Name
Real Name 2018 年 6 月 28 日
編集済み: Real Name 2018 年 6 月 28 日
Thanks for the answer. Although I don't feel too comfortable changing the video camera function, I'm mainly concerned about if this loop will be able to run fast enough such that I can see updates happening in real time. The computer I'm working off of is pretty slow.
Do you know of another parallel processing way of doing this?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Support Package for IP Cameras についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by