How to call one of the outputs of the function?

I have a function below. I have three outputs in this function which are "phi_ave_x, phi_ave_y, phi_ave_z", as seen below. How can call one of this outputs from this function in another code file. Thank you.
function [phi_ave_x, phi_ave_y, phi_ave_z] = crk4_aee321_Lorentz(xi,yi,zi,dt)

답변 (2개)

Fangjun Jiang
Fangjun Jiang 2022년 10월 24일
편집: Fangjun Jiang 2022년 10월 24일

0 개 추천

phi_ave_x = crk4_aee321_Lorentz(xi,yi,zi,dt)
[phi_ave_x, phi_ave_y] = crk4_aee321_Lorentz(xi,yi,zi,dt)
[phi_ave_x, phi_ave_y, phi_ave_z] = crk4_aee321_Lorentz(xi,yi,zi,dt)
[~, phi_ave_y, phi_ave_z] = crk4_aee321_Lorentz(xi,yi,zi,dt)
[~, ~, phi_ave_z] = crk4_aee321_Lorentz(xi,yi,zi,dt)
Jan
Jan 2022년 10월 24일

0 개 추천

[phi_ave_x, phi_ave_y, phi_ave_z] = crk4_aee321_Lorentz(xi,yi,zi,dt);
disp(phi_ave_y)
This uses the 2nd output phi_ave_y as input for the disp() command.

카테고리

도움말 센터 및 File Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기

질문:

2022년 10월 24일

편집:

2022년 10월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by