Don't let the function display any output

Hello guys,
I have a function which I can't access to the code and so, I can't change anything within the function. The problem is that the function is printing in the command window every time. How can I prevent that function to print without getting inside the function? I've of course already tried ; after calling it.
Thank you!

댓글 수: 1

Stephen23
Stephen23 2017년 5월 3일
@ben dp: point out to whomever wrote that code that uncontrolled printing to the command window is an insult to humanity, slows the code, irritates the user, and is ultimately useless because no one can understand five hundred lines a second of scrolled text.

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

답변 (2개)

Guillaume
Guillaume 2017년 5월 2일
편집: Guillaume 2017년 5월 2일

0 개 추천

You could wrap the call to the function in evalc. The downside, as with any eval function is that it is slower and you lose syntax highlighting.
Probably best is to live with the output to the command window.

댓글 수: 7

ben dp
ben dp 2017년 5월 2일
편집: ben dp 2017년 5월 2일
No, the objective of stop displaying the output is to win processing time. That display is really making me loose to much time. If using evalc will make me loose more time, then it is not the good solution :\ but thank you!
evalc() has to keep allocating memory as the computation goes on. That can be lead to slowness.
On the other hand, displaying data to the command window is typically slower than allocating memory is.
ben dp
ben dp 2017년 5월 2일
편집: per isakson 2017년 5월 3일
Ok but then now the problem is that I need the memory. I have very huge data to classify in my SVM :/ Anyway, I was gonna try the evalc like this :
evalc('vl_hog(single(imgExtended(l-8:l+7,c-4:c+3,:)), 8, 'verbose','numOrientations', numOrientations);')
But is not working because of the ' in my function.
If you have any other solutions, they are welcome
>> disp('Here''s how to include a quote in a char vector')
Also remember you can assign those strings to variables and pass the variables.
ben dp
ben dp 2017년 5월 3일
Disp is to display in the command window, but that's not what I want to do. Or I didn't understand your idea...
evalc('vl_hog(single(imgExtended(l-8:l+7,c-4:c+3,:)), 8, ''verbose'',''numOrientations'', numOrientations);')

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

Rafi egal
Rafi egal 2017년 5월 3일
편집: Rafi egal 2017년 5월 3일

0 개 추천

you could use clc if you have no terminal output above which is to be used.
Maybe you can temporarily disable warnings before calling the function and after goint out of that function enable them once again: https://ch.mathworks.com/help/matlab/matlab_prog/suppress-warnings.html

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

질문:

2017년 5월 2일

댓글:

2017년 5월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by