An open exchange for the MATLAB and Simulink user community |
Hosted by The MathWorks |
|
| Related Topics |
| New Products | Support | Documentation | Training | Webinars | Jobs | Newsletters |
| Problems? Suggestions? Contact us at files@mathworks.com | © 1994-2008 The MathWorks, Inc. Trademarks Privacy Policy |
Doug:
Good tutorial, as always. One thing that every time confuses me are the varargin, nargin, varargout, nargout options in a function. I believe that many users of Matlab also have the same problem.
Could you, in a future post (may be a video), talk about them? I would be very gratefull if this happens.
Yours,
JanKees
can you show me how to write another function the would ask the user the value for the input of the variable
Justin,
You are going to want to use the INPUT command.
>> a = input(’Give me a number: ‘)
Enjoy,
Doug
function [choose] = a()
choose=input(’Solve ‘,’s’);
switch choose
case {’Is’}
h()
case ‘Ic’
disp(’c')
otherwise
disp(’unknown’)
end;
displayed in the command window
ans
Is
What if i dont want Is to be displayed what should I do?
Justin,
The display is coming from the results of the function a() being called.
>>a();
The semicolon will supress the print as you want.
Doug