Example for simple function with two parameters in matlab


%Let us discuss the function with two paramaters with simple example
%We know the formula for the volume of a cone is p*(1/3)*r^2*h


conevolmain.m
clc;
clear all;
radius = input('Enter the radus of the cone:');
height = input('Enter the height of the cone:');
cv=conevol(radius,height);
fprintf('Volume of the cone with radius %.1f \n and with height %.1f', radius,height);
fprintf('\n is:  %.2f'\n,cv);



conevol.m
function out=conevol(radius,height)
out=(pi/3)*radius^2*height;
end


output:



Enter the radus of the cone:5.6
Enter the height of the cone:6
Volume of the cone with radius 5.6
 and with height 6.0
 is:  197.04


Comments

  1. It's time to work with new project and make more clients. Make photography business more effective by taking our editing service. In fact, if you are really serious about your financial success, you can deal with Clipping Path Adept. We will give you the best editing service within your budget and it's on time.

    ReplyDelete
  2. The above Example for simple function with two parameters in matlab is very understanding content, you can also Learn Digital Image Processing with Adaptable Online Videos Course Materials Video Lectures on
    Digital Image Processing from Superior Faculty

    ReplyDelete

Post a Comment

Popular posts from this blog

Matlab code to get negative of an image

To find the MSE value

Vidicon Camera Tube