필터 지우기
필터 지우기

Syntax for work space output and multiple variables to work space

조회 수: 1 (최근 30일)
Tony
Tony 2016년 3월 19일
댓글: Star Strider 2016년 3월 24일
Hi, I am trying to run a program and output more than one variable. Not sure on the syntax, but here is what I am going for:
function [Project, Counter] = NumberCycle(num,times2run)
(code)
end
I would like Mat lab to output the Project variable as one matrix in the work space and the Counter variable as a completely separate matrix in the work space. That way I could click on either variable when I need to look at them.
Lastly, when you send a variable to the work space, mat lab spits out that information in the command window as well (even if suppressed in the code), is there a way to stop that?
Any help is appreciated, thanks!

채택된 답변

Star Strider
Star Strider 2016년 3월 19일
‘I would like Mat lab to output the Project variable as one matrix in the work space and the Counter variable as a completely separate matrix in the work space.’
Call your function from your script file as:
[Project, Counter] = NumberCycle(num,times2run);
‘Lastly, when you send a variable to the work space, mat lab spits out that information in the command window as well (even if suppressed in the code), is there a way to stop that?’
If I understand correctly, put a semicolon ‘;’ at the end of the line calling your function (as I did here).
  댓글 수: 6
Tony
Tony 2016년 3월 24일
Yeah, not really sure to be honest. I will mess with the code a little more later on. Thanks for your help so far and with the suggestion using script files.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by