How to pass contents of cell array to a function?

2 次查看(过去 30 天)
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
madhan ravi 2019-1-4
  7 个评论
snowflake
snowflake 2019-1-4
Nevermind, I just used cell2mat to convert those cell arrays and properly put them in the function def, thank you

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by