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

조회 수: 5 (최근 30일)
Almas Adil
Almas Adil 2018년 6월 9일
댓글: Almas Adil 2018년 6월 9일
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

채택된 답변

Birdman
Birdman 2018년 6월 9일
편집: Birdman 2018년 6월 9일
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.
  댓글 수: 2
Almas Adil
Almas Adil 2018년 6월 9일
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 2018년 6월 9일
and convmass and convlength are wroking without defining function.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Unit Conversions에 대해 자세히 알아보기

제품


릴리스

R2012b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by