How to add a field to a matlab struct.

조회 수: 5 (최근 30일)
Daniel Boateng
Daniel Boateng 2019년 3월 15일
댓글: madhan ravi 2019년 3월 15일
I have a matlab function that takes a struct array in my workspace as an input.The struct has fields a and b. I want to add another field c in the struct. Please how fdo I do this.

답변 (1개)

madhan ravi
madhan ravi 2019년 3월 15일
yourstruct.c=...;
% doc setfield()
  댓글 수: 7
Daniel Boateng
Daniel Boateng 2019년 3월 15일
Thanks bro. It works perfectly
madhan ravi
madhan ravi 2019년 3월 15일
Thank you Guillaume for the explanation.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by