How to pass contents of cell array to a function?
이전 댓글 표시
I have
function [S , U ] = HOSVD ( A )
where U is a cell array of length 3
and I would like the function to return each cell. I tried
function [S , U{1}, U{2}, U{3} ] = HOSVD ( A )
but it doesn't work, it gives an error regarding the brackets.
How should I write it?
답변 (1개)
madhan ravi
2019년 1월 4일
U{:}
댓글 수: 7
snowflake
2019년 1월 4일
madhan ravi
2019년 1월 4일
편집: madhan ravi
2019년 1월 4일
Provide all the datas and your code. You function definition seems to be wrong. Also see how to define a function:
snowflake
2019년 1월 4일
madhan ravi
2019년 1월 4일
unfolding , tensormat???
snowflake
2019년 1월 4일
madhan ravi
2019년 1월 4일
alternatively you can use
vertcat(U{:})
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!