フィルターのクリア

operator > is not supported for operands type of cell

52 ビュー (過去 30 日間)
Hagar Hendy
Hagar Hendy 2022 年 11 月 18 日
コメント済み: Hagar Hendy 2022 年 11 月 18 日
I load mnist data set in matlab, and i load the weights that i got it from tensor flow and i want to implement this equations to get gex, gin , but when i try that this error shown " operator > is not supported for operands type of cell "
load(' w.mat ')
Rmin = 1e5
Rmax = 1e6
Gmin = 1.0/Rmax
Gmax = 1.0/Rmin
if (w >= 0)
gex = Gmax*w + Gmin*(1-w)
gin = Gmin
else
gex = Gmin
gin = -Gmax*w + Gmin*(1+w)
end
This is the weights as shown in the screenshot (1*4 cell)

採用された回答

Steven Lord
Steven Lord 2022 年 11 月 18 日
None of the relational operators are defined for cell arrays. A cell array can contain basically any type of data you can create in MATLAB. In the example below, if > were defined for cell arrays what would you expect y to be?
c = {-5:5, magic(4)-3, @sin, {42}, "abracadabra"}
c = 1×5 cell array
{[-5 -4 -3 -2 -1 0 1 2 3 4 5]} {4×4 double} {@sin} {1×1 cell} {["abracadabra"]}
% y = c > 0
While > is not defined for cell arrays it can be defined for the types inside a cell. Index into the cell with curly braces to extract the data stored inside it then use > on that data.
y2 = c{1} > 0
y2 = 1×11 logical array
0 0 0 0 0 0 1 1 1 1 1

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by