student Interview Question for Students
- 0of 0 votes
AnswersThe nargin and nargout command returns the number of input and output respectively for a function.
- jinglan.seiran April 25, 2014
nargin is particularly useful when the input values are trivial. For example (0, 0) seems to be trivial
input in Q5. Modify the program so that the default value of (a,b) is (0,0) whenever it is not specifed
by the user.
Q5:The following function is supposed to generate an array of Cartesian coordinates for a circle with
radius r and centered at (a; b).
function [x,y] = circle(r,theta)
theta = [0:pi/100:2*pi];
x = r*cos(theta);
y = r*sin(theta);
end| Report Duplicate | Flag | PURGE
Student student
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.