Executing a fprintf statement with a function
조회 수: 3 (최근 30일)
이전 댓글 표시
How would I be able to pass and fprintf a tsring in the code below? The code below is faulty and not working
a= pass('hello');
function output = pass(var)
fprintf('%s', var);
end
댓글 수: 0
답변 (1개)
Image Analyst
2021년 12월 3일
Get rid of a=, or else assign a inside of the function. Right now you are trying to accept something into a in your calling routine, but the function does not pass anything back. So call it like this:
pass('hello');
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!