how to divide two structures?
조회 수: 3 (최근 30일)
이전 댓글 표시
A is a structure. B is a structure. i need to perform A/B. How to get it?
댓글 수: 1
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
2013년 3월 4일
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})
??
댓글 수: 0
Azzi Abdelmalek
2013년 3월 4일
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)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!