Stop some outputs of a function

2 ビュー (過去 30 日間)
F.O
F.O 2017 年 11 月 21 日
コメント済み: Star Strider 2017 年 11 月 21 日
%I have this function
function [ B,H,Z,I ] = magfun( lambda )
r=6371*10^3 ; %in m
u0=4*pi*10^-7 ; %in kg m A^-2 S^-2
m=7.94*10^22 ;%in A m^2
%lambda=90-theta ; % in degree
theta=90-lambda; % in degree
Bh=(-u0*m*sind(theta)/(4*pi*r^3))/10^-9 ; % We divided on 10^-9 to ge it in nanotesla
Br=(-2*u0*m*cosd(theta)/(4*pi*r^3))/10^-9; % We divided on 10^-9 to ge it in nanotesla
Bv=0;
H=abs(Bh); %in nanotesla
Z=-Br; %in degree
B=sqrt(Br.^2+Bh.^2+Bv.^2); % nanotesla
I=2*tand(lambda); %in degree
end
% and this script
lambda=[-22.828870 60.409000 22409];
[ B,H,Z,I ] = magfun( lambda )
%I just want to outputs B and I and not all of them , is it possible to do it?

採用された回答

Star Strider
Star Strider 2017 年 11 月 21 日
‘I just want to outputs B and I and not all of them , is it possible to do it?’
Yes. Call it as:
[ B,~,~,I ] = magfun( lambda )
  2 件のコメント
F.O
F.O 2017 年 11 月 21 日
Thanks friend. I t worked
Star Strider
Star Strider 2017 年 11 月 21 日
As always, my pleasure.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by