Divide a cell arrays with a part of another cell array?

2 ビュー (過去 30 日間)
Abdullah Türk
Abdullah Türk 2018 年 12 月 28 日
コメント済み: Abdullah Türk 2018 年 12 月 28 日
Hello everyone,
I have a 1x1 and 1x5 cell array with names A and B respectively. Here is my code:
for i = 1:5
C{i,1} = B{1,i}(1,:) ./ A;
end
An error occurs in this loop :
Undefined operator './' for input arguments of type 'cell'.
How can I solve this problem? Thanks in advance.

採用された回答

Stephen23
Stephen23 2018 年 12 月 28 日
編集済み: Stephen23 2018 年 12 月 28 日
Division is not defined for container classes (like cell arrays), it is only defined for numeric types. Which means that you will need to get whatever numeric data you have stored in A out of A, before doing any numeric operations on it:
B{1,i}(1,:) ./ A{1}
% ^^^

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by