how to divide two structures?

A is a structure. B is a structure. i need to perform A/B. How to get it?

댓글 수: 1

Jan
Jan 2013년 3월 4일
Currently we can only guess, what the "/" operator should do for your data. Does "structure" mean STRUCT arrays? Should something happen with the fields?

댓글을 달려면 로그인하십시오.

답변 (2개)

Walter Roberson
Walter Roberson 2013년 3월 4일

0 개 추천

You do not. What would it even mean? What would you expect as the result of
struct('P', {5:10}, 'Q', {magic(17)}) / struct('S', {'hello'}, 'T', false(7,8), 'P', {2})
??
Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 4일

0 개 추천

A=struct('a1',num2cell(1:10))
B=struct('b1',num2cell(11:20))
C=cellfun(@(x,y) x/y,struct2cell(A),struct2cell(B),'un',0)
C=cell2struct(C,{'c1'},1)

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by