How can I write a matlab function to take one number and display double, triple, and quadruple of the number?
조회 수: 2 (최근 30일)
이전 댓글 표시
Can you make it also using M-file?
댓글 수: 0
답변 (1개)
Image Analyst
2022년 2월 24일
Do you mean like
function fun(a)
fprintf('a = %f\n2*a = %f\n3*a = %f\n4*a = %f', a, 2*a, 3*a, 4*a);
Of course you can do it in an m-file. How else were you thinking of doing it?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!