Send variables to workspace from a function

조회 수: 28 (최근 30일)
Diego
Diego 2012년 12월 7일
Dear all,
I'm trying to send some arrays from my function to the workspace.
My function always return the first output argument to the workspace (Z in this case) as ans without showing the remaining variables.
My function is like this:
function [Z,rp,ij]=tryB( X )
...
[r,p] = corrcoef(Z);
rp=[r,p];
[i,j] = find(p<0.05);
ij=[i,j];
...
end
As you can see, I want to load into the workspace a matrix rp and a matrix ij.
How can I accomplish that?
Thanks,
Diego

채택된 답변

Walter Roberson
Walter Roberson 2012년 12월 7일
Call the function as
[Z,rp,ij] = tryB(X)

추가 답변 (1개)

Diego
Diego 2012년 12월 7일
Thank you very much Walter!
Kind Regards,
Diego

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by