%Q-1.. %If statement syntax: if expression %statement.. elseif expression %statement.. else %statement.. end %
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
please in need run this with matlab
%Q-1.. %If statement syntax: if expression
%statement.. elseif expression
%statement.. else
%statement.. end %
Q-2.. %To take the input from user.. x=input("Enter the number")
% if statement to check the number is greater than 100.. if x>100 disp('Value is greater than 100') end
%if statement to check the number is less than or equal to 100.. if x<=100 disp('Value is less than or equal to 100') end %
Q-3.. %To take the input from user.. x=input("Enter the number")
% if statement to check the number is greater than 100.. if x>100 disp('Value is greater than 100')
% else statement to check the number is less than or equal to 100.. else disp('Value is less than or equal to 100') end %
Q-4.. %To take the input from user.. x=input("Enter a random number : ")
% if statement to check the number is greater than 100.. if x>100 disp('The entered grade is invalid > 100') end % if statement to check the number is less than or equal to 100.. if x<=100 % if statement to check the number is between 90 and 100.. if x>=90 && x<=100 disp('Your grade is A') end % if statement to check the number is greater than or equal to 80 and less than 90.. if x>=80 && x<90 disp("Your grade is B") end
% if statement to check the number is greater than or equal to 70 and less than 80.. if x>=70 && x<80 disp("Your grade is C") end
% if statement to check the number is greater than or equal to 60 and less than 70.. if x>=60 && x<70 disp("Your grade is D") end
% if statement to check the number is greater than or equal to 0 and less than 60.. if x>=0 && x<60 disp("Your grade is F") end %To check that if the number is less than 0.. if x<0 disp("The entered grade is invalid < 0") end end
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images