フィルターのクリア

arrayfun error

3 ビュー (過去 30 日間)
Mary Kodogianni
Mary Kodogianni 2011 年 4 月 2 日
Hello to everyone,
I have an array of structs g1 = repmat(struct('x0', 0),3,1); g1(1).x0=[1 2 3 69 4 5 ] g1(2).x0=[1 2 3 6 4 5 ] g1(3).x0=[1 32 4 6 4 5 ] and t1= repmat(struct('x0', 0),1,1); t1.x0=69
I m writing the following d= arrayfun(@(t1)isequal(t1.x0),g1) and i get ??? Error using ==> isequal Not enough input arguments.
Error in ==> @(t1)isequal(t1.x0)
Plz help me i've stuck with it...

採用された回答

Matt Fig
Matt Fig 2011 年 4 月 2 日
Please go back and reformat your question. Use the button that looks like this:
{} Code
on the code you pasted in the window.
Now, this is not an ARRAYFUN error but an ISEQUAL error. ISEQUAL takes two arguments.
isequal(9,8)
isequal(pi,pi)
What are you trying to compare? Do you mean this:
d= arrayfun(@(x) eq(x.x0,t1.x0),g1,'Un',0)

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by