필터 지우기
필터 지우기

Hello! How I can use output data from one function as an input for another. And write it in one function

조회 수: 1 (최근 30일)
Hi! Kindly ask to check where I did mistake . I am trying to use output data [A, B, C, D, E] from another function reflection5 (i calculated it in reflection5 function)
in new function planeLocation5 as an input
this is one function file
function [p, Xr, Yr, Zr, Theta, Phi, Plane ] = planeLocation5(A, B, C, D, E)
[A, B, C, D, E] = reflection5(X0, Y0, Z0, Theta0, Phi0); %i believe this should be correct, butit doesnt work
planes(:,:,1) = [0 3 3; 0 0 3; 0 3 0; 0 0 0; 0 0 0];
planes(:,:,2) = [0 0 3; 3 0 3; 0 0 0; 3 0 0; 0 0 0];
.......
end
at the end I will combine in one main
  댓글 수: 2
Stephen23
Stephen23 2023년 3월 6일
Why not just call them like this?:
[A, B, C, D, E] = reflection5(X0, Y0, Z0, Theta0, Phi0);
[p, Xr, Yr, Zr, Theta, Phi, Plane ] = planeLocation5(A, B, C, D, E);
Aknur
Aknur 2023년 3월 6일
Hi @Stephen23 thank you for your answer. I am calling like this in main where I apply for loop for both function. But when I want run function planeLocation5 separately in planeLocation5.m file I am trying to call data output from function reflection5

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by