How can I write a matlab function to take one number and display double, triple, and quadruple of the number?
    3 次查看(过去 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!

