MATLAB Answers

function [CM KG]=STtosi(In,Ib) It is not working

4 views (last 30 days)
Almas Adil
Almas Adil on 9 Jun 2018
Commented: Almas Adil on 9 Jun 2018
i have built a function to convert Ib to kg and in to cm. but it is not working my code function [CM KG]=STtosi(In,Ib) CM=(100*convlength([In],'in','m')) KG=convmass([Ib],'lbm','kg') end


Sign in to comment.

Accepted Answer

Birdman on 9 Jun 2018
Edited: Birdman on 9 Jun 2018
Since you did not mention why the function is not working, it may have two reasons:
- Firstly, you need to save your function with its function name in your current directory and then call from command line like
[CM,KG]=STtosi(1,2) %inputs are random
and the above one worked for me.
-To be able to use convmass and convlength, you need to have Aerospace Toolbox license. If you do not have, please check it.
Hope this helps.


Almas Adil
Almas Adil on 9 Jun 2018
thanks for your rply. i am getting this type of error when running myfun Error using myfun (line 2) Not enough input arguments.
Almas Adil
Almas Adil on 9 Jun 2018
and convmass and convlength are wroking without defining function.

Sign in to comment.

More Answers (0)

Sign in to answer this question.