フィルターのクリア

How to pass contents of cell array to a function?

2 ビュー (過去 30 日間)
snowflake
snowflake 2019 年 1 月 4 日
コメント済み: madhan ravi 2019 年 1 月 4 日
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
madhan ravi
madhan ravi 2019 年 1 月 4 日
alternatively you can use
vertcat(U{:})

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by