get a field from struct

2 ビュー (過去 30 日間)
Dommal
Dommal 2016 年 5 月 20 日
コメント済み: Dommal 2016 年 5 月 20 日
Hi everyone,
I have a problem with getfield funtion. I have 1x9 struct with 5 fields. I want to get 4th field, called pval. Each raw of this field contains a matrix 2x1. I'm trying :
A=getfield(Getval, 'pval')
But that only returns the first raw of the field:
A =
0.0000
0.0011
I want to have a matrix 2x9 or 9x2 with all rows from the field pval.
Looking forward to your suggestions.

採用された回答

Walter Roberson
Walter Roberson 2016 年 5 月 20 日
A = [Getval.pval];
  1 件のコメント
Dommal
Dommal 2016 年 5 月 20 日
Works like a charm! Thanks!

サインインしてコメントする。

その他の回答 (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