Assiging indexed values to a structure field

조회 수: 1 (최근 30일)
z8080
z8080 2020년 8월 6일
I would like a field of my indexed structure to take on a value similarly indexed in a different vector:
struc(1:3).value=1:3
However, this gives the error "Expected one output from a curly brace or dot indexing expression, but there were 2 results."
Enclosing either the left- or the right-hand side of the assignment line in square brackets does not help.
How can I achieve this variable assignment, other than by using a for loop?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by